← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13137: dynamic filtering of context-menus based on access properties (canManage, canUpdate, canDelete)

 

------------------------------------------------------------
revno: 13137
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-04 13:58:11 +0100
message:
  dynamic filtering of context-menus based on access properties (canManage, canUpdate, canDelete)
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm
  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
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.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-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js	2013-12-04 11:47:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js	2013-12-04 12:58:11 +0000
@@ -86,13 +86,10 @@
   });
 
   $list.on('click.context', 'tr', function( e ) {
-    if(dhis2.contextmenu.disable()) {
+    if( dhis2.contextmenu.disable() ) {
       return false;
     }
 
-    $menu.show();
-    $menu.css({left: e.pageX, top: e.pageY});
-
     var $target = $(e.target);
 
     if( $target.data('id') === undefined ) {
@@ -105,6 +102,18 @@
       $menu.data(val, $target.data(val));
     });
 
+    $menu.find('ul > li').each(function( idx, val ) {
+      var $val = $(val);
+      var enabledProperty = $val.data('enabled');
+
+      if( enabledProperty ) {
+        $target.data(enabledProperty) ? $val.show() : $val.hide();
+      }
+    });
+
+    $menu.show();
+    $menu.css({left: e.pageX, top: e.pageY});
+
     return false;
   });
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm	2013-12-04 12:58:11 +0000
@@ -16,10 +16,10 @@
 
 <div id="contextMenu" class="contextMenu">
   <ul id="contextMenuItems" class="contextMenuItems">
-    #if( $security.canManage( $dataDictionary ) )<li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>#end
-    #if( $security.canUpdate( $dataDictionary ) )<li><a data-target-fn="showUpdateDataDictionaryForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>#end
-    #if( $security.canUpdate( $dataDictionary ) )<li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>#end
-    #if( $security.canDelete( $dataDictionary ) )<li><a data-target-fn="removeDataDictionary"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>#end
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="showUpdateDataDictionaryForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="removeDataDictionary"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showDataDictionaryDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -41,10 +41,11 @@
         </thead>
 				<tbody id="list">
 				#foreach( $dataDictionary in $dataDictionaries )
-				<tr id="tr${dataDictionary.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!dataDictionary.id" data-uid="$!dataDictionary.uid" data-type="DataDictionary" data-name="$encoder.htmlEncode( $!dataDictionary.displayName )">
-            $encoder.htmlEncode( $!dataDictionary.displayName )
-          </td>
+				<tr id="tr${dataDictionary.id}" data-id="$!dataDictionary.id" data-uid="$!dataDictionary.uid" data-type="DataDictionary" data-name="$encoder.htmlEncode( $!dataDictionary.displayName )"
+            data-can-manage="$security.canManage( $dataDictionary )"
+            data-can-update="$security.canUpdate( $dataDictionary )"
+            data-can-delete="$security.canDelete( $dataDictionary )">
+            <td>$encoder.htmlEncode( $!dataDictionary.displayName )</td>
 				</tr>
 				#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2013-12-04 10:20:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2013-12-04 12:58:11 +0000
@@ -32,10 +32,10 @@
 
 <div id="contextMenu" class="contextMenu">
   <ul id="contextMenuItems" class="contextMenuItems">
-    #if( $security.canManage( $dataElement ) )<li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>#end
-    #if( $security.canUpdate( $dataElement ) )<li><a data-target-fn="showUpdateDataElementForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>#end
-    #if( $security.canUpdate( $dataElement ) )<li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>#end
-    #if( $security.canDelete( $dataElement ) )<li><a data-target-fn="removeDataElement"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>#end
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="showUpdateDataElementForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="removeDataElement"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showDataElementDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -70,10 +70,11 @@
         </thead>
         <tbody id="list">
           #foreach( $dataElement in $dataElements )
-          <tr id="tr${dataElement.id}">
-            <td style="padding: 12px 0 12px 5px;" data-id="$!dataElement.id" data-uid="$!dataElement.uid" data-type="DataElement" data-name="$encoder.htmlEncode( $!dataElement.displayName )">
-              $encoder.htmlEncode( $!dataElement.displayName )
-            </td>
+          <tr id="tr${dataElement.id}" data-id="$!dataElement.id" data-uid="$!dataElement.uid" data-type="DataElement" data-name="$encoder.htmlEncode( $!dataElement.displayName )"
+              data-can-manage="$security.canManage( $dataElement )"
+              data-can-update="$security.canUpdate( $dataElement )"
+              data-can-delete="$security.canDelete( $dataElement )">
+              <td>$encoder.htmlEncode( $!dataElement.displayName )</td>
           </tr>
           #end
         </tbody>

=== 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-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm	2013-12-04 12:58:11 +0000
@@ -38,10 +38,11 @@
 				</thead>
 				<tbody id="list">
 				#foreach( $dataElementGroup in $dataElementGroups )
-				<tr id="tr${dataElementGroup.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!dataElementGroup.id" data-uid="$!dataElementGroup.uid" data-type="DataElementGroup" data-name="$encoder.htmlEncode( $!dataElementGroup.displayName )">
-            $encoder.htmlEncode( $!dataElementGroup.displayName )
-          </td>
+				<tr id="tr${dataElementGroup.id}" data-id="$!dataElementGroup.id" data-uid="$!dataElementGroup.uid" data-type="DataElementGroup" data-name="$encoder.htmlEncode( $!dataElementGroup.displayName )"
+            data-can-manage="$security.canManage( $dataElementGroup )"
+            data-can-update="$security.canUpdate( $dataElementGroup )"
+            data-can-delete="$security.canDelete( $dataElementGroup )">
+          <td>$encoder.htmlEncode( $!dataElementGroup.displayName )</td>
 				</tr>
 				#end
 				</tbody>

=== 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-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm	2013-12-04 12:58:11 +0000
@@ -38,10 +38,11 @@
 				</thead>
 				<tbody id="list">
 					#foreach( $dataElementGroupSet in $dataElementGroupSets )
-					<tr id="tr${dataElementGroupSet.id}">
-            <td style="padding: 12px 0 12px 5px;" ata-id="$!dataElementGroupSet.id" data-uid="$!dataElementGroupSet.uid" data-type="DataElementGroupSet" data-name="$encoder.htmlEncode( $!dataElementGroupSet.displayName )">
-              $encoder.htmlEncode( $!dataElementGroupSet.displayName )
-            </td>
+					<tr id="tr${dataElementGroupSet.id}"  data-id="$!dataElementGroupSet.id" data-uid="$!dataElementGroupSet.uid" data-type="DataElementGroupSet" data-name="$encoder.htmlEncode( $!dataElementGroupSet.displayName )"
+              data-can-manage="$security.canManage( $dataElementGroupSet )"
+              data-can-update="$security.canUpdate( $dataElementGroupSet )"
+              data-can-delete="$security.canDelete( $dataElementGroupSet )">
+            <td>$encoder.htmlEncode( $!dataElementGroupSet.displayName )</td>
 					</tr>
 					#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2013-12-04 12:58:11 +0000
@@ -19,10 +19,10 @@
 
 <div id="contextMenu" class="contextMenu">
   <ul id="contextMenuItems" class="contextMenuItems">
-    #if( $security.canManage( $indicator ) )<li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>#end
-    #if( $security.canUpdate( $indicator ) )<li><a data-target-fn="showUpdateIndicatorForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>#end
-    #if( $security.canUpdate( $indicator ) )<li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>#end
-    #if( $security.canDelete( $indicator ) )<li><a data-target-fn="removeIndicator"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>#end
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="showUpdateIndicatorForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="removeIndicator"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showIndicatorDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -61,10 +61,11 @@
 				</thead>
 				<tbody id="list">
 				#foreach( $indicator in $indicators )
-				<tr id="tr${indicator.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!indicator.id" data-uid="$!indicator.uid" data-type="Indicator" data-name="$encoder.htmlEncode( $!indicator.displayName )">
-            $encoder.htmlEncode( $!indicator.displayName )
-          </td>
+				<tr id="tr${indicator.id}" data-id="$!indicator.id" data-uid="$!indicator.uid" data-type="Indicator" data-name="$encoder.htmlEncode( $!indicator.displayName )"
+            data-can-manage="$security.canManage( $indicator )"
+            data-can-update="$security.canUpdate( $indicator )"
+            data-can-delete="$security.canDelete( $indicator )">
+          <td>$encoder.htmlEncode( $!indicator.displayName )</td>
 				</tr>
 				#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm	2013-12-04 12:58:11 +0000
@@ -16,10 +16,10 @@
 
 <div id="contextMenu" class="contextMenu">
   <ul id="contextMenuItems" class="contextMenuItems">
-    #if( $security.canManage( $indicatorGroup ) )<li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>#end
-    #if( $security.canUpdate( $indicatorGroup ) )<li><a data-target-fn="showUpdateIndicatorGroupForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>#end
-    #if( $security.canUpdate( $indicatorGroup ) )<li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>#end
-    #if( $security.canDelete( $indicatorGroup ) )<li><a data-target-fn="removeIndicatorGroup"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>#end
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="showUpdateIndicatorGroupForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="removeIndicatorGroup"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showIndicatorGroupDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -41,10 +41,11 @@
         </thead>
 				<tbody id="list">
 				#foreach( $indicatorGroup in $indicatorGroups )
-				<tr id="tr${indicatorGroup.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!indicatorGroup.id" data-uid="$!indicatorGroup.uid" data-type="IndicatorGroup" data-name="$encoder.htmlEncode( $!indicatorGroup.displayName )">
-            $encoder.htmlEncode( $!indicatorGroup.displayName )
-          </td>
+				<tr id="tr${indicatorGroup.id}" data-id="$!indicatorGroup.id" data-uid="$!indicatorGroup.uid" data-type="IndicatorGroup" data-name="$encoder.htmlEncode( $!indicatorGroup.displayName )"
+            data-can-manage="$security.canManage( $indicatorGroup )"
+            data-can-update="$security.canUpdate( $indicatorGroup )"
+            data-can-delete="$security.canDelete( $indicatorGroup )">
+          <td>$encoder.htmlEncode( $!indicatorGroup.displayName )</td>
 				</tr>
 				#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm	2013-12-04 12:58:11 +0000
@@ -16,10 +16,10 @@
 
 <div id="contextMenu" class="contextMenu">
   <ul id="contextMenuItems" class="contextMenuItems">
-    #if( $security.canManage( $indicatorGroupSet ) )<li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>#end
-    #if( $security.canUpdate( $indicatorGroupSet ) )<li><a data-target-fn="showUpdateIndicatorGroupSetForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>#end
-    #if( $security.canUpdate( $indicatorGroupSet ) )<li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>#end
-    #if( $security.canDelete( $indicatorGroupSet ) )<li><a data-target-fn="deleteIndicatorGroupSet"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>#end
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="showUpdateIndicatorGroupSetForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="deleteIndicatorGroupSet"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showIndicatorGroupSetDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -41,10 +41,11 @@
       </thead>
       <tbody id="list">
 					#foreach( $indicatorGroupSet in $indicatorGroupSets )
-					<tr id="tr${indicatorGroupSet.id}">
-            <td style="padding: 12px 0 12px 5px;" data-id="$!indicatorGroupSet.id" data-uid="$!indicatorGroupSet.uid" data-type="IndicatorGroupSet" data-name="$encoder.htmlEncode( $!indicatorGroupSet.displayName )">
-              $encoder.htmlEncode( $!indicatorGroupSet.displayName )
-            </td>
+					<tr id="tr${indicatorGroupSet.id}" data-id="$!indicatorGroupSet.id" data-uid="$!indicatorGroupSet.uid" data-type="IndicatorGroupSet" data-name="$encoder.htmlEncode( $!indicatorGroupSet.displayName )"
+              data-can-manage="$security.canManage( $indicatorGroupSet )"
+              data-can-update="$security.canUpdate( $indicatorGroupSet )"
+              data-can-delete="$security.canDelete( $indicatorGroupSet )">
+            <td>$encoder.htmlEncode( $!indicatorGroupSet.displayName )</td>
 					</tr>
 					#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm	2013-12-04 12:58:11 +0000
@@ -58,10 +58,11 @@
         </thead>
 				<tbody id="list">
 				#foreach( $indicatorType in $indicatorTypes )
-				<tr id="tr${indicatorType.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!indicatorType.id" data-uid="$!indicatorType.uid" data-type="IndicatorType" data-name="$encoder.htmlEncode( $!indicatorType.displayName )">
-            $encoder.htmlEncode( $!indicatorType.displayName )
-          </td>
+				<tr id="tr${indicatorType.id}" data-id="$!indicatorType.id" data-uid="$!indicatorType.uid" data-type="IndicatorType" data-name="$encoder.htmlEncode( $!indicatorType.displayName )"
+            data-can-manage="$security.canManage( $indicatorType )"
+            data-can-update="$security.canUpdate( $indicatorType )"
+            data-can-delete="$security.canDelete( $indicatorType )">
+          <td>$encoder.htmlEncode( $!indicatorType.displayName )</td>
 				</tr>
 				#end
 				</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm	2013-12-04 12:58:11 +0000
@@ -59,10 +59,11 @@
       <tbody id="list">
         #foreach( $dataElementCategory in $dataElementCategories )
         #if( $dataElementCategory.id != $defaultCategory.id )
-        <tr id="tr${dataElementCategory.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!dataElementCategory.id" data-uid="$!dataElementCategory.uid" data-type="DataElementCategory" data-name="$encoder.htmlEncode( $!dataElementCategory.displayName )">
-            $encoder.htmlEncode( $!dataElementCategory.displayName )
-          </td>
+        <tr id="tr${dataElementCategory.id}" data-id="$!dataElementCategory.id" data-uid="$!dataElementCategory.uid" data-type="DataElementCategory" data-name="$encoder.htmlEncode( $!dataElementCategory.displayName )"
+            data-can-manage="$security.canManage( $dataElementCategory )"
+            data-can-update="$security.canUpdate( $dataElementCategory )"
+            data-can-delete="$security.canDelete( $dataElementCategory )">
+          <td>$encoder.htmlEncode( $!dataElementCategory.displayName )</td>
         </tr>
         #end
         #end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2013-12-04 12:58:11 +0000
@@ -36,10 +36,11 @@
       <tbody id="list">
         #foreach( $dataElementCategoryCombo in $dataElementCategoryCombos )
         #if( $dataElementCategoryCombo.id != $defaultCombo.id )
-        <tr id="tr${dataElementCategoryCombo.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!dataElementCategoryCombo.id" data-uid="$!dataElementCategoryCombo.uid" data-type="DataElementCategoryCombo" data-name="$encoder.htmlEncode( $!dataElementCategoryCombo.displayName )">
-            $encoder.htmlEncode( $!dataElementCategoryCombo.displayName )
-          </td>
+        <tr id="tr${dataElementCategoryCombo.id}" data-id="$!dataElementCategoryCombo.id" data-uid="$!dataElementCategoryCombo.uid" data-type="DataElementCategoryCombo" data-name="$encoder.htmlEncode( $!dataElementCategoryCombo.displayName )"
+            data-can-manage="$security.canManage( $dataElementCategoryCombo )"
+            data-can-update="$security.canUpdate( $dataElementCategoryCombo )"
+            data-can-delete="$security.canDelete( $dataElementCategoryCombo )">
+          <td>$encoder.htmlEncode( $!dataElementCategoryCombo.displayName )</td>
         </tr>
         #end
         #end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm	2013-12-04 12:58:11 +0000
@@ -60,10 +60,11 @@
           <tbody id="list">
             #foreach( $dataElementCategoryOption in $dataElementCategoryOptions )
             #if( $dataElementCategoryOption.id != $defaultCategory.id )
-              <tr id="tr${dataElementCategoryOption.id}">
-                <td style="padding: 12px 0 12px 5px;" data-id="$!dataElementCategoryOption.id" data-uid="$!dataElementCategoryOption.uid" data-type="DataElementCategoryOption" data-name="$encoder.htmlEncode( $!dataElementCategoryOption.displayName )">
-                  $encoder.htmlEncode( $!dataElementCategoryOption.displayName )
-                </td>
+              <tr id="tr${dataElementCategoryOption.id}" data-id="$!dataElementCategoryOption.id" data-uid="$!dataElementCategoryOption.uid" data-type="DataElementCategoryOption" data-name="$encoder.htmlEncode( $!dataElementCategoryOption.displayName )"
+                  data-can-manage="$security.canManage( $dataElementCategoryOption )"
+                  data-can-update="$security.canUpdate( $dataElementCategoryOption )"
+                  data-can-delete="$security.canDelete( $dataElementCategoryOption )">
+                <td>$encoder.htmlEncode( $!dataElementCategoryOption.displayName )</td>
               </tr>
 			      #end
             #end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm	2013-12-02 11:11:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm	2013-12-04 12:58:11 +0000
@@ -36,10 +36,11 @@
 				<tbody id="list">
 				#foreach( $concept in $concepts )
 				#if( $concept.id != $defaultConcept.id )
-				<tr id="tr${concept.id}">
-          <td style="padding: 12px 0 12px 5px;" data-id="$!concept.id" data-uid="$!concept.uid" data-type="Concept" data-name="$encoder.htmlEncode( $!concept.displayName )">
-            $encoder.htmlEncode( $!concept.displayName )
-          </td>
+				<tr id="tr${concept.id}" data-id="$!concept.id" data-uid="$!concept.uid" data-type="Concept" data-name="$encoder.htmlEncode( $!concept.displayName )"
+            data-can-manage="$security.canManage( $concept )"
+            data-can-update="$security.canUpdate( $concept )"
+            data-can-delete="$security.canDelete( $concept )">
+          <td>$encoder.htmlEncode( $!concept.displayName )</td>
 				</tr>
 				#end
 				#end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm	2013-12-04 11:47:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm	2013-12-04 12:58:11 +0000
@@ -18,14 +18,14 @@
 
 <div id="contextMenu" class="contextMenu" style="width: 240px;">
   <ul id="contextMenuItems" class="contextMenuItems">
-    <li><a data-target-fn="defineDataSetAssociationsForm"><i class="fa fa-plus"></i>&nbsp;&nbsp;$i18n.getString( "define_associations" )</a></li>
-    <li><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
-    <li><a data-target-fn="editDataSetForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
-    <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
-    <li><a data-target-fn="viewDataEntryForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "design_data_entry_form" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="defineDataSetAssociationsForm"><i class="fa fa-plus"></i>&nbsp;&nbsp;$i18n.getString( "define_associations" )</a></li>
+    <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="editDataSetForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="viewDataEntryForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "design_data_entry_form" )</a></li>
     <li><a data-target-fn="exportPdfDataSet"><i class="fa fa-files-o"></i>&nbsp;&nbsp;$i18n.getString( "pdf_data_entry_form" )</a></li>
-    <li><a data-target-fn="displayCompulsoryDataElementsForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit_compulsory_data_elements" )</a></li>
-    <li><a data-target-fn="removeDataSet"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
+    <li data-enabled="canUpdate"><a data-target-fn="displayCompulsoryDataElementsForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit_compulsory_data_elements" )</a></li>
+    <li data-enabled="canDelete"><a data-target-fn="removeDataSet"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
     <li><a data-target-fn="showDataSetDetails"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;$i18n.getString( "show_details" )</a></li>
   </ul>
 </div>
@@ -51,7 +51,10 @@
         </thead>
         <tbody id="list">
           #foreach( $dataSet in $dataSets )
-            <tr id="tr${dataSet.id}" data-id="$!dataSet.id" data-uid="$!dataSet.uid" data-type="DataSet" data-name="$encoder.htmlEncode( $!dataSet.displayName )">
+            <tr id="tr${dataSet.id}" data-id="$!dataSet.id" data-uid="$!dataSet.uid" data-type="DataSet" data-name="$encoder.htmlEncode( $!dataSet.displayName )"
+              data-can-manage="$security.canManage( $dataSet )"
+              data-can-update="$security.canUpdate( $dataSet )"
+              data-can-delete="$security.canDelete( $dataSet )">
               <td>$encoder.htmlEncode( $!dataSet.displayName )</td>
             </tr>
           #end