dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21440
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10154: Remove sharing for de-group, de-group-set. Also clear out sharing data, if it exists in db.
------------------------------------------------------------
revno: 10154
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-12 16:49:17 +0700
message:
Remove sharing for de-group, de-group-set. Also clear out sharing data, if it exists in db.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java 2013-02-28 05:17:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java 2013-03-12 09:49:17 +0000
@@ -87,6 +87,7 @@
PUBLIC_AUTHORITIES.put( DataElement.class, "F_DATAELEMENT_PUBLIC_ADD" );
PRIVATE_AUTHORITIES.put( DataElement.class, "F_DATAELEMENT_PRIVATE_ADD" );
+ /*
SUPPORTED_TYPES.put( "dataElementGroup", DataElementGroup.class );
PUBLIC_AUTHORITIES.put( DataElementGroup.class, "F_DATAELEMENTGROUP_PUBLIC_ADD" );
PRIVATE_AUTHORITIES.put( DataElementGroup.class, "F_DATAELEMENTGROUP_PRIVATE_ADD" );
@@ -94,6 +95,7 @@
SUPPORTED_TYPES.put( "dataElementGroupSet", DataElementGroupSet.class );
PUBLIC_AUTHORITIES.put( DataElementGroupSet.class, "F_DATAELEMENTGROUPSET_PUBLIC_ADD" );
PRIVATE_AUTHORITIES.put( DataElementGroupSet.class, "F_DATAELEMENTGROUPSET_PRIVATE_ADD" );
+ */
SUPPORTED_TYPES.put( "indicator", Indicator.class );
PUBLIC_AUTHORITIES.put( Indicator.class, "F_INDICATOR_PUBLIC_ADD" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-03-11 14:31:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-03-12 09:49:17 +0000
@@ -527,7 +527,13 @@
executeSql( "ALTER TABLE datadictionary DROP CONSTRAINT datadictionary_name_key" );
upgradeReportTableColumns();
-
+
+ // clear out sharing of de-group/de-group-set for now
+ executeSql( "UPDATE dataelementgroup SET userid=NULL WHERE userid IS NOT NULL" );
+ executeSql( "UPDATE dataelementgroup SET publicaccess=NULL WHERE userid IS NOT NULL" );
+ executeSql( "UPDATE dataelementgroupset SET userid=NULL WHERE userid IS NOT NULL" );
+ executeSql( "UPDATE dataelementgroupset SET publicaccess=NULL WHERE userid IS NOT NULL" );
+
log.info( "Tables updated" );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm 2013-03-01 04:09:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm 2013-03-12 09:49:17 +0000
@@ -1,5 +1,5 @@
-#sharingDialog()
+#* #sharingDialog() *#
<script type="text/javascript">
jQuery(document).ready(function(){
@@ -38,29 +38,33 @@
<td onclick="showDataElementGroupDetails( $dataElementGroup.id )">$encoder.htmlEncode( $dataElementGroup.displayName )</td>
<td style="text-align:right">
- #if ( $security.canManage( $dataElementGroup ) )
+ #* #if ( $security.canManage( $dataElementGroup ) )
<a href="javascript:showSharingDialog('dataElementGroup', '$dataElementGroup.uid');"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
#else
<img src="../images/relationship-denied.png">
- #end
+ #end *#
- #if( $security.canUpdate( $dataElementGroup ) )
+ #* #if( $security.canUpdate( $dataElementGroup ) ) *#
<a href="showUpdateDataElementGroupForm.action?id=$dataElementGroup.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+ #*
#else
<img src="../images/edit-denied.png">
- #end
+ #end *#
- #if( $security.canUpdate( $dataElementGroup ) )
+ #* #if( $security.canUpdate( $dataElementGroup ) ) *#
<a href="javascript:translate( 'DataElementGroup', '$dataElementGroup.id' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+ #*
#else
<img src="../images/i18n-denied.png">
#end
+ *#
- #if( $security.canDelete( $dataElementGroup ) )
+ #* #if( $security.canDelete( $dataElementGroup ) ) *#
<a href="javascript:removeDataElementGroup( $dataElementGroup.id, '$encoder.jsEncode( $dataElementGroup.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
- #else
+ #* #else
<img src="../images/delete-denied.png">
#end
+ *#
<a href="javascript:showDataElementGroupDetails( $dataElementGroup.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm 2013-01-22 13:37:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm 2013-03-12 09:49:17 +0000
@@ -1,5 +1,5 @@
-#sharingDialog()
+#* #sharingDialog() *#
<script type="text/javascript">
jQuery(document).ready(function(){
@@ -38,29 +38,33 @@
<td onclick="showDataElementGroupSetDetails( $dataElementGroupSet.id )">$encoder.htmlEncode( $dataElementGroupSet.displayName )</td>
<td style="text-align:right">
- #if ( $security.canManage( $dataElementGroupSet ) )
+ #* #if ( $security.canManage( $dataElementGroupSet ) )
<a href="javascript:showSharingDialog('dataElementGroupSet', '$dataElementGroupSet.uid');"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
#else
<img src="../images/relationship-denied.png">
#end
+ *#
- #if( $security.canUpdate( $dataElementGroupSet ) )
+ #* #if( $security.canUpdate( $dataElementGroupSet ) ) *#
<a href="openUpdateDataElementGroupSet.action?id=$dataElementGroupSet.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+ #*
#else
<img src="../images/edit-denied.png">
#end
+ *#
- #if( $security.canUpdate( $dataElementGroupSet ) )
+ #* #if( $security.canUpdate( $dataElementGroupSet ) ) *#
<a href="javascript:translate( 'DataElementGroupSet', '$dataElementGroupSet.id' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- #else
+ #* #else
<img src="../images/i18n-denied.png">
- #end
+ #end *#
- #if( $security.canDelete( $dataElementGroupSet ) )
+ #* #if( $security.canDelete( $dataElementGroupSet ) ) *#
<a href="javascript:deleteDataElementGroupSet( $dataElementGroupSet.id, '$encoder.jsEncode( $dataElementGroupSet.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
- #else
+ #* #else
<img src="../images/delete-denied.png">
#end
+ *#
<a href="javascript:showDataElementGroupSetDetails( $dataElementGroupSet.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>