← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9654: sharing for indicator, dataelement

 

------------------------------------------------------------
revno: 9654
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-01-30 10:20:49 +0700
message:
  sharing for indicator, dataelement
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-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml
  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/indicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_es_ES.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_fr_FR.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_my_MM.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_pt_PT.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_vi_VN.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_zh_CN.properties


--
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-01-27 21:03:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java	2013-01-30 03:20:49 +0000
@@ -28,10 +28,12 @@
  */
 
 import org.hisp.dhis.datadictionary.DataDictionary;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.document.Document;
+import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.report.Report;
@@ -79,6 +81,10 @@
         PUBLIC_AUTHORITIES.put( DataDictionary.class, "F_DATADICTIONARY_PUBLIC_ADD" );
         PRIVATE_AUTHORITIES.put( DataDictionary.class, "F_DATADICTIONARY_PRIVATE_ADD" );
 
+        SUPPORTED_TYPES.put( "dataElement", DataElement.class );
+        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" );
@@ -87,13 +93,17 @@
         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" );
+        PRIVATE_AUTHORITIES.put( Indicator.class, "F_INDICATOR_PRIVATE_ADD" );
+
         SUPPORTED_TYPES.put( "indicatorGroup", IndicatorGroup.class );
-        PUBLIC_AUTHORITIES.put( IndicatorGroup.class, "F_DATAELEMENTGROUPSET_PUBLIC_ADD" );
-        PRIVATE_AUTHORITIES.put( IndicatorGroup.class, "F_DATAELEMENTGROUPSET_PRIVATE_ADD" );
+        PUBLIC_AUTHORITIES.put( IndicatorGroup.class, "F_INDICATORGROUP_PUBLIC_ADD" );
+        PRIVATE_AUTHORITIES.put( IndicatorGroup.class, "F_INDICATORGROUP_PRIVATE_ADD" );
 
         SUPPORTED_TYPES.put( "indicatorGroupSet", IndicatorGroupSet.class );
-        PUBLIC_AUTHORITIES.put( IndicatorGroupSet.class, "F_DATAELEMENTGROUPSET_PUBLIC_ADD" );
-        PRIVATE_AUTHORITIES.put( IndicatorGroupSet.class, "F_DATAELEMENTGROUPSET_PRIVATE_ADD" );
+        PUBLIC_AUTHORITIES.put( IndicatorGroupSet.class, "F_INDICATORGROUPSET_PUBLIC_ADD" );
+        PRIVATE_AUTHORITIES.put( IndicatorGroupSet.class, "F_INDICATORGROUPSET_PRIVATE_ADD" );
     }
 
     public static boolean isSupported( String type )

=== 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-01-25 15:24:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2013-01-30 03:20:49 +0000
@@ -489,9 +489,11 @@
         executeSql( "UPDATE userroleauthorities SET authority='F_DATASET_PUBLIC_ADD' WHERE authority='F_DATASET_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_DATADICTIONARY_PUBLIC_ADD' WHERE authority='F_DATADICTIONARY_ADD'" );
 
+        executeSql( "UPDATE userroleauthorities SET authority='F_DATAELEMENT_PUBLIC_ADD' WHERE authority='F_DATAELEMENT_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_DATAELEMENTGROUP_PUBLIC_ADD' WHERE authority='F_DATAELEMENTGROUP_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_DATAELEMENTGROUPSET_PUBLIC_ADD' WHERE authority='F_DATAELEMENTGROUPSET_ADD'" );
 
+        executeSql( "UPDATE userroleauthorities SET authority='F_INDICATOR_PUBLIC_ADD' WHERE authority='F_INDICATOR_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_INDICATORGROUP_PUBLIC_ADD' WHERE authority='F_INDICATORGROUP_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_INDICATORGROUPSET_PUBLIC_ADD' WHERE authority='F_INDICATORGROUPSET_ADD'" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2012-10-24 20:50:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2013-01-30 03:20:49 +0000
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <!DOCTYPE hibernate-mapping PUBLIC
-    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
-    [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
-    >
+  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
+  [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+  >
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.dataelement.DataElement" table="dataelement">
@@ -26,16 +26,16 @@
     <property name="type" column="valuetype" length="16" not-null="true" />
 
     <property name="numberType" column="numbertype" length="16" />
-    
-   	<property name="textType" column="textType" length="16" />
+
+    <property name="textType" column="textType" length="16" />
 
     <property name="domainType" column="domaintype" length="16" />
 
     <property name="aggregationOperator" not-null="true" column="aggregationtype" length="16" />
 
     <many-to-one name="categoryCombo" class="org.hisp.dhis.dataelement.DataElementCategoryCombo"
-        column="categorycomboid"
-        foreign-key="fk_dataelement_categorycomboid" />
+      column="categorycomboid"
+      foreign-key="fk_dataelement_categorycomboid" />
 
     <property name="sortOrder" />
 
@@ -61,6 +61,17 @@
 
     <property name="zeroIsSignificant" not-null="true" />
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_dataelement_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="dataelementusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="dataelementid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
     <!-- Dynamic attribute values -->
 
     <set name="attributeValues" table="dataelementattributevalues">
@@ -70,10 +81,10 @@
     </set>
 
     <many-to-one name="optionSet" class="org.hisp.dhis.option.OptionSet" column="optionsetid"
-        foreign-key="fk_dataelement_optionsetid" />
+      foreign-key="fk_dataelement_optionsetid" />
 
-	<many-to-one name="legendSet" class="org.hisp.dhis.mapping.MapLegendSet" column="legendsetid"
-		foreign-key="fk_dataelement_legendset" />
+    <many-to-one name="legendSet" class="org.hisp.dhis.mapping.MapLegendSet" column="legendsetid"
+      foreign-key="fk_dataelement_legendset" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2012-10-24 20:50:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2013-01-30 03:20:49 +0000
@@ -3,7 +3,7 @@
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
   [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+  >
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.indicator.Indicator" table="indicator">
@@ -14,7 +14,7 @@
       <generator class="native" />
     </id>
     &identifiableProperties;
-    
+
     <property name="shortName" column="shortname" not-null="true" unique="true" length="50" />
 
     <property name="description" type="text" />
@@ -48,16 +48,27 @@
       <many-to-many class="org.hisp.dhis.dataset.DataSet" column="datasetid" />
     </set>
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_indicator_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="indicatorusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="indicatorid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
     <!-- Dynamic attribute values -->
 
     <set name="attributeValues" table="indicatorattributevalues">
       <cache usage="read-write" />
       <key column="indicatorid" />
-      <many-to-many class="org.hisp.dhis.attribute.AttributeValue" column="attributevalueid" unique="true"/>
+      <many-to-many class="org.hisp.dhis.attribute.AttributeValue" column="attributevalueid" unique="true" />
     </set>
 
-	<many-to-one name="legendSet" class="org.hisp.dhis.mapping.MapLegendSet" column="legendsetid"
-		foreign-key="fk_indicator_legendset" />
+    <many-to-one name="legendSet" class="org.hisp.dhis.mapping.MapLegendSet" column="legendsetid"
+      foreign-key="fk_indicator_legendset" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2013-01-30 03:20:49 +0000
@@ -54,12 +54,12 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/addDataElementForm.vm</param>
       <param name="javascripts">javascript/shortName.js,javascript/dataElement.js</param>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="addDataElement" class="org.hisp.dhis.dd.action.dataelement.AddDataElementAction">
       <result name="success" type="redirect">dataElement.action</result>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateDataElementForm" class="org.hisp.dhis.dd.action.dataelement.ShowUpdateDataElementFormAction">
@@ -270,12 +270,12 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/addIndicatorForm.vm</param>
       <param name="javascripts">javascript/shortName.js,javascript/indicator.js</param>
-      <param name="requiredAuthorities">F_INDICATOR_ADD</param>
+      <param name="anyAuthorities">F_INDICATOR_PUBLIC_ADD, F_INDICATOR_PRIVATE_ADD</param>
     </action>
 
     <action name="addIndicator" class="org.hisp.dhis.dd.action.indicator.AddIndicatorAction">
       <result name="success" type="redirect">indicator.action</result>
-      <param name="requiredAuthorities">F_INDICATOR_ADD</param>
+      <param name="anyAuthorities">F_INDICATOR_PUBLIC_ADD, F_INDICATOR_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateIndicatorForm" class="org.hisp.dhis.dd.action.indicator.ShowUpdateIndicatorFormAction">
@@ -456,19 +456,13 @@
     </action>
 
     <action name="getIndicatorType" class="org.hisp.dhis.dd.action.indicatortype.GetIndicatorTypeAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonIndicatorType.vm
-      </result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonIndicatorType.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
 
     <action name="removeIndicatorType" class="org.hisp.dhis.dd.action.indicatortype.RemoveIndicatorTypeAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseSuccess.vm
-      </result>
-      <result name="error" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseError.vm
-      </result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
       <param name="requiredAuthorities">F_INDICATORTYPE_DELETE</param>
     </action>
@@ -570,12 +564,12 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm</param>
       <param name="javascripts">javascript/category.js</param>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="addDataElementCategory" class="org.hisp.dhis.dd.action.category.AddDataElementCategoryAction">
       <result name="success" type="redirect">category.action</result>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="validateDataElementCategory" class="org.hisp.dhis.dd.action.category.ValidateDataElementCategoryAction">
@@ -630,7 +624,7 @@
       <result name="success" type="velocity-json">
         /dhis-web-commons/ajax/jsonCategoryOption.vm
       </result>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="updateDataElementCategoryOption" class="org.hisp.dhis.dd.action.category.UpdateDataElementCategoryOptionAction">
@@ -653,12 +647,12 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm</param>
       <param name="javascripts">javascript/categoryCombo.js</param>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="addDataElementCategoryCombo" class="org.hisp.dhis.dd.action.categorycombo.AddDataElementCategoryComboAction">
       <result name="success" type="redirect">categoryCombo.action</result>
-      <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
+      <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
     <action name="validateDataElementCategoryCombo" class="org.hisp.dhis.dd.action.categorycombo.ValidateDataElementCategoryComboAction">

=== 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-01-24 12:08:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2013-01-30 03:20:49 +0000
@@ -1,3 +1,6 @@
+
+#sharingDialog()
+
 <script type="text/javascript">
 	jQuery(document).ready(function(){	
 		tableSorter( 'dataElementList' );	
@@ -57,7 +60,7 @@
 			<div id="content">
 			<table class="listTable" id="dataElementList">
 				<col/>				
-				<col width="120px"/>          
+				<col width="145px"/>
                 <thead>				
 					<tr>
 						<th>$i18n.getString( "name" )</th>
@@ -69,10 +72,33 @@
 				<tr id="tr${dataElement.id}">
 					<td onclick="showDataElementDetails( $dataElement.id )">$encoder.htmlEncode( $dataElement.displayName )</td>
 					<td style="text-align:right">
-					  <a href="showUpdateDataElementForm.action?id=$dataElement.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
-					  <a href="javascript:translate( 'DataElement', '$dataElement.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
-					  <a href="javascript:removeDataElement( $dataElement.id, '$encoder.jsEncode( $dataElement.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
-					  <a href="javascript:showDataElementDetails( $dataElement.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
+
+                    #if ( $security.canManage( $dataElement ) )
+                    <a href="javascript:showSharingDialog('dataElement', '$dataElement.uid');"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
+                    #else
+                    <img src="../images/relationship-denied.png">
+                    #end
+
+                    #if( $security.canUpdate( $dataElement ) )
+                    <a href="showUpdateDataElementForm.action?id=$dataElement.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( $dataElement ) )
+                    <a href="javascript:translate( 'DataElement', '$dataElement.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+                    #else
+                    <img src="../images/i18n-denied.png">
+                    #end
+
+                    #if( $security.canDelete( $dataElement ) )
+                    <a href="javascript:removeDataElement( $dataElement.id, '$encoder.jsEncode( $dataElement.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+                    #else
+                    <img src="../images/delete-denied.png">
+                    #end
+
+                    <a href="javascript:showDataElementDetails( $dataElement.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
+
 					</td>
 				</tr>
 				#end

=== 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	2012-11-04 11:24:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2013-01-30 03:20:49 +0000
@@ -1,3 +1,6 @@
+
+#sharingDialog()
+
 <script type="text/javascript">
 	jQuery(document).ready(function(){	
 		tableSorter( 'listTable' );	
@@ -43,7 +46,7 @@
 			</table>
 			<table class="listTable" id="listTable">				
 				<col/>				
-				<col width="120px"/>
+				<col width="145px"/>
 				<thead>	
 				<tr>
 					<th>$i18n.getString( "name" )</th>
@@ -55,9 +58,31 @@
 				<tr id="tr${indicator.id}">
 					<td onclick="showIndicatorDetails( $indicator.id )">$encoder.htmlEncode( $indicator.displayName )</td>
 					<td style="text-align:right">
-					<a href="showUpdateIndicatorForm.action?id=$indicator.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
-					<a href="javascript:translate( 'Indicator', '$indicator.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
-					<a href="javascript:removeIndicator( $indicator.id, '$encoder.jsEncode( $indicator.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+
+                    #if ( $security.canManage( $indicator ) )
+                    <a href="javascript:showSharingDialog('indicator', '$indicator.uid');"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
+                    #else
+                    <img src="../images/relationship-denied.png">
+                    #end
+
+                    #if( $security.canUpdate( $indicator ) )
+                    <a href="showUpdateIndicatorForm.action?id=$indicator.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( $indicator ) )
+                    <a href="javascript:translate( 'Indicator', '$indicator.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+                    #else
+                    <img src="../images/i18n-denied.png">
+                    #end
+
+                    #if( $security.canDelete( $indicator ) )
+                    <a href="javascript:removeIndicator( $indicator.id, '$encoder.jsEncode( $indicator.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+                    #else
+                    <img src="../images/delete-denied.png">
+                    #end
+
 					<a href="javascript:showIndicatorDetails( $indicator.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
 					</td>
 				</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-01-29 15:19:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-01-30 03:20:49 +0000
@@ -42,16 +42,20 @@
 F_CONSTANT_UPDATE=Update Constant
 F_DATAADMIN_LOCK=Data Admin Locking
 F_DATAADMIN_UNLOCK=Data Admin UnLocking
-F_DATAELEMENT_ADD=Add Data Element
+F_DATAELEMENT_PUBLIC_ADD=Add Public Data Element
+F_DATAELEMENT_PRIVATE_ADD=Add Private Data Element
 F_DATAELEMENT_DELETE=Delete Data Element
 F_DATAELEMENT_UPDATE=Update Data Element
 F_DATAELEMENTGROUP_PUBLIC_ADD=Add Public Data Element Groups
+F_DATAELEMENTGROUP_PRIVATE_ADD=Add Private Data Element Groups
 F_DATAELEMENTGROUP_DELETE=Delete Data Element Groups
 F_DATAELEMENTGROUP_UPDATE=Updated Data Element Groups
 F_DATAELEMENTGROUPSET_PUBLIC_ADD=Add Public Data Element Group Sets
+F_DATAELEMENTGROUPSET_PRIVATE_ADD=Add Private Data Element Group Sets
 F_DATAELEMENTGROUPSET_DELETE=Delete Data Element Group Sets
 F_DATAELEMENTGROUPSET_UPDATE=Update Data Element Group Sets
 F_DATADICTIONARY_PUBLIC_ADD=Add Public Data Dictionary
+F_DATADICTIONARY_PRIVATE_ADD=Add Private Data Dictionary
 F_DATADICTIONARY_UPDATE=Update Data Dictionary
 F_DATADICTIONARY_DELETE=Delete Data Dictionary
 F_DATAELEMENT_MINMAX_ADD=Add Min/max rule
@@ -70,15 +74,18 @@
 F_DATAVALUE_DELETE=Delete Data Value
 F_DATAVALUE_UPDATE=Update Data Value
 F_INDICATORGROUP_PUBLIC_ADD=Add Public Indicator Group
+F_INDICATORGROUP_PRIVATE_ADD=Add Private Indicator Group
 F_INDICATORGROUP_DELETE=Delete Indicator Group
 F_INDICATORGROUP_UPDATE=Update Indicator Group
 F_INDICATORTYPE_ADD=Add Indicator Type
 F_INDICATORTYPE_DELETE=Delete Indicator Type
 F_INDICATORTYPE_UPDATE=Update Indicator Type
-F_INDICATOR_ADD=Add Indicator
+F_INDICATOR_PUBLIC_ADD=Add Public Indicator
+F_INDICATOR_PRIVATE_ADD=Add Private Indicator
 F_INDICATOR_DELETE=Delete Indicator
 F_INDICATOR_UPDATE=Update Indicator
 F_INDICATORGROUPSET_PUBLIC_ADD=Add Public Indicator Group Sets
+F_INDICATORGROUPSET_PRIVATE_ADD=Add Private Indicator Group Sets
 F_INDICATORGROUPSET_DELETE=Delete Indicator Group Sets
 F_INDICATORGROUPSET_UPDATE=Update Indicator Group Sets
 F_ORGANISATIONUNIT_ADD=Add Organisation Unit

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_es_ES.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_es_ES.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_es_ES.properties	2013-01-30 03:20:49 +0000
@@ -56,7 +56,7 @@
 F_ORGUNITGROUPSET_ADD=A\u00f1adir Conjunto de Grupos de Unidad Organizativa
 F_VALIDATIONRULE_ADD=A\u00f1adir Regla de Validaci\u00f3n
 name=Nombre
-F_DATAELEMENT_ADD=A\u00f1adir Elemento de Dato
+F_DATAELEMENT_PUBLIC_ADD=A\u00f1adir Elemento de Dato
 F_DATAELEMENT_MINMAX_ADD=A\u00f1adir regla Minimo/Maximo
 M_dhis-web-openhealth-integration=Ver m\u00f3dulo de integraci\u00f3n de Openhealth
 F_USERROLE_UPDATE=Actualizar Rol de Usuario
@@ -89,7 +89,7 @@
 firstName=Nombre
 F_DATASET_DELETE=Eliminar Conjunto de Datos
 change=Cambiar
-F_INDICATOR_ADD=A\u00f1adir Indicador
+F_INDICATOR_PUBLIC_ADD=A\u00f1adir Indicador
 F_ORGUNITGROUP_DELETE=Eliminar Grupo de Unidad Organizativa
 F_REPORT_UPDATE=Actualizar Informe
 details=Detalles

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_fr_FR.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_fr_FR.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_fr_FR.properties	2013-01-30 03:20:49 +0000
@@ -38,7 +38,7 @@
 F_CONSTANT_UPDATE=Modifier constante
 F_DATAADMIN_LOCK=Verrouillage des donn\u00e9es
 F_DATAADMIN_UNLOCK=D\u00e9verrouillage des donn\u00e9es
-F_DATAELEMENT_ADD=Ajouter \u00e9l\u00e9ments de donn\u00e9es
+F_DATAELEMENT_PUBLIC_ADD=Ajouter \u00e9l\u00e9ments de donn\u00e9es
 F_DATAELEMENT_DELETE=Supprimer \u00e9l\u00e9ments de donn\u00e9es
 F_DATAELEMENT_UPDATE=Modier \u00e9l\u00e9ments de donn\u00e9es
 F_DATAELEMENTGROUP_PUBLIC_ADD=Ajouter groupes d'\u00e9l\u00e9ments de donn\u00e9es
@@ -70,7 +70,7 @@
 F_INDICATORTYPE_ADD=Ajouter type d'indicateur
 F_INDICATORTYPE_DELETE=Supprimer type d'indicateur
 F_INDICATORTYPE_UPDATE=Modifier type d'indicateur
-F_INDICATOR_ADD=Ajouter indicateur
+F_INDICATOR_PUBLIC_ADD=Ajouter indicateur
 F_INDICATOR_DELETE=Supprimer indicateur
 F_INDICATOR_UPDATE=Modifier indicateur
 F_INDICATORGROUPSET_PUBLIC_ADD=Ajouter ensemble de groupes d'indicateurs

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_my_MM.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_my_MM.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_my_MM.properties	2013-01-30 03:20:49 +0000
@@ -38,7 +38,7 @@
 F_CONSTANT_UPDATE=\u1000\u102d\u1014\u103a\u1038\u101e\u1031\u1000\u102d\u102f \u1015\u103c\u1004\u103a\u1006\u1004\u103a\u1019\u103d\u1019\u103a\u1038\u1019\u1036\u1001\u103c\u1004\u103a\u1038
 F_DATAADMIN_LOCK=Data Admin \u1000\u102d\u102f Lock \u1001\u103b\u1011\u102c\u1038\u1015\u102b\u101e\u100a\u103a\u104b
 F_DATAADMIN_UNLOCK=Data Admin \u1000\u102d\u102f Lock \u1019\u101c\u102f\u1015\u103a\u1011\u102c\u1038\u1015\u102b\u104b
-F_DATAELEMENT_ADD=Data \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1015\u1031\u102b\u1004\u103a\u1038\u1011\u100a\u1037\u103a\u101e\u100a\u103a\u104b
+F_DATAELEMENT_PUBLIC_ADD=Data \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1015\u1031\u102b\u1004\u103a\u1038\u1011\u100a\u1037\u103a\u101e\u100a\u103a\u104b
 F_DATAELEMENT_DELETE=Data \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1016\u103b\u1000\u103a\u1015\u102b\u104b
 F_DATAELEMENT_UPDATE=Data \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1015\u103c\u1004\u103a\u1006\u1004\u103a\u1019\u103d\u1019\u103a\u1038\u1019\u1036\u101e\u100a\u103a\u104b
 F_DATAELEMENTGROUP_PUBLIC_ADD=Data \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038\u1021\u102f\u1015\u103a\u1005\u102f\u1019\u103b\u102c\u1038\u101e\u102d\u102f\u1037 \u1015\u1031\u102b\u1004\u103a\u1038\u1011\u100a\u1037\u103a\u101e\u100a\u103a\u104b
@@ -70,7 +70,7 @@
 F_INDICATORTYPE_ADD=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1015\u1031\u102b\u1004\u103a\u1038\u1011\u100a\u1037\u103a\u101e\u100a\u103a\u104b
 F_INDICATORTYPE_DELETE=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1016\u103b\u1000\u103a\u101e\u100a\u103a\u104b
 F_INDICATORTYPE_UPDATE=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1015\u103c\u1004\u103a\u1006\u1004\u103a\u1019\u103d\u1019\u103a\u1038\u1019\u1036\u101e\u100a\u103a\u104b
-F_INDICATOR_ADD=\u1021\u100a\u103d\u103e\u1014\u103a\u1038 \u1015\u1031\u102b\u1004\u103a\u1038\u101e\u100a\u103a\u104b
+F_INDICATOR_PUBLIC_ADD=\u1021\u100a\u103d\u103e\u1014\u103a\u1038 \u1015\u1031\u102b\u1004\u103a\u1038\u101e\u100a\u103a\u104b
 F_INDICATOR_DELETE=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1016\u103b\u1000\u103a\u101e\u100a\u103a\u104b
 F_INDICATOR_UPDATE=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1015\u103c\u1004\u103a\u1006\u1004\u103a\u1019\u103d\u1019\u103a\u1038\u1019\u1036\u101e\u100a\u103a\u104b
 F_INDICATORGROUPSET_PUBLIC_ADD=\u1021\u100a\u103d\u103e\u1014\u103a\u1038\u1021\u102f\u1015\u103a\u1005\u102f \u1021\u1005\u102f \u1015\u1031\u102b\u1004\u103a\u1038\u1011\u100a\u1037\u103a\u101e\u100a\u103a\u104b

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_pt_PT.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_pt_PT.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_pt_PT.properties	2013-01-30 03:20:49 +0000
@@ -38,7 +38,7 @@
 F_CONSTANT_UPDATE=Actualizar Constante
 F_DATAADMIN_LOCK=Bloqueio de Administrac\u00e3o de Dados
 F_DATAADMIN_UNLOCK=Desbloqueio de Administrac\u00e3o de Dados
-F_DATAELEMENT_ADD=Adicionar Elemento de Dados
+F_DATAELEMENT_PUBLIC_ADD=Adicionar Elemento de Dados
 F_DATAELEMENT_DELETE=Apagar Elemento de Dados
 F_DATAELEMENT_UPDATE=Actualizar Elemento Dados
 F_DATAELEMENTGROUP_PUBLIC_ADD=Adicionar Grupos de Elementos de Dados
@@ -70,7 +70,7 @@
 F_INDICATORTYPE_ADD=Adicionar Tipo Indicador
 F_INDICATORTYPE_DELETE=Apagar Tipo Indicador
 F_INDICATORTYPE_UPDATE=Actualizar Tipo Indicador
-F_INDICATOR_ADD=Adicionar Indicador
+F_INDICATOR_PUBLIC_ADD=Adicionar Indicador
 F_INDICATOR_DELETE=Apagar Indicador
 F_INDICATOR_UPDATE=Actualizar Indicador
 F_INDICATORGROUPSET_PUBLIC_ADD=Adicionar Grupo Indicadores

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_vi_VN.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_vi_VN.properties	2013-01-30 03:20:49 +0000
@@ -88,7 +88,7 @@
 can_not_remove_last_super_user=Kh\u00f4ng th\u1ec3 x\u00f3a ng\u01b0\u1eddi d\u00f9ng cao c\u1ea5p l\u1ea7n tr\u01b0\u1edbc.
 F_VALIDATIONRULE_ADD=Th\u00eam lu\u1eadt ki\u1ec3m tra t\u00ednh h\u1ee3p l\u1ec7
 F_DATAADMIN_LOCK=Kh\u00f3a d\u1eef li\u1ec7u
-F_DATAELEMENT_ADD=Th\u00eam ph\u1ea7n t\u1eed d\u1eef li\u1ec7u
+F_DATAELEMENT_PUBLIC_ADD=Th\u00eam ph\u1ea7n t\u1eed d\u1eef li\u1ec7u
 user_group_management=Qu\u1ea3n tr\u1ecb nh\u00f3m ng\u01b0\u1eddi d\u00f9ng
 F_SEND_MESSAGE=G\u1eedi tin
 F_DATAELEMENT_MINMAX_ADD=Th\u00eam gi\u00e1 tr\u1ecb l\u1edbn nh\u1ea5t/nh\u1ecf nh\u1ea5t
@@ -152,7 +152,7 @@
 F_DATASET_DELETE=X\u00f3a t\u1eadp h\u1ee3p d\u1eef li\u1ec7u
 change=Thay \u0111\u1ed5i
 F_ORGUNITGROUP_DELETE=X\u00f3a nh\u00f3m \u0111\u01a1n v\u1ecb
-F_INDICATOR_ADD=Th\u00eam ch\u1ec9 s\u1ed1
+F_INDICATOR_PUBLIC_ADD=Th\u00eam ch\u1ec9 s\u1ed1
 F_RELATIONSHIPTYPE_DELETE=X\u00f3a lo\u1ea1i quan h\u1ec7
 operations=Thao t\u00e1c
 F_INDICATORGROUPSET_PUBLIC_ADD=Th\u00eam T\u1eadp h\u1ee3p nh\u00f3m ch\u1ec9 s\u1ed1

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_zh_CN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_zh_CN.properties	2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module_zh_CN.properties	2013-01-30 03:20:49 +0000
@@ -157,7 +157,7 @@
 F_VALIDATIONCRITERIA_ADD=\u6DFB\u52A0\u9A8C\u8BC1\u6807\u51C6
 F_DATASET_UPDATE=\u66F4\u65B0\u6570\u636E\u96C6
 F_DATAELEMENTGROUP_UPDATE=\u66F4\u65B0\u6570\u636E\u5143\u7EC4
-F_INDICATOR_ADD=\u6DFB\u52A0\u6307\u6807
+F_INDICATOR_PUBLIC_ADD=\u6DFB\u52A0\u6307\u6807
 intro_user_group=\u521B\u5EFA\u7528\u6237\u7EC4\u7684\u529F\u80FD\uFF0C\u8BE5\u7EC4\u5E94\u8BE5\u5DE5\u4F5C\u5728\u4E00\u4E2A\u7528\u6237\u7EC4\uFF0C\u4F8B\u5982\u901A\u77E5\u5355
 F_DATAVALUE_UPDATE=\u66F4\u65B0\u6570\u636E\u503C
 F_MOBILE_SENDSMS=\u53D1\u9001\u77ED\u4FE1
@@ -227,7 +227,7 @@
 user_management=\u7528\u6237\u7BA1\u7406
 F_EXCEL_TEMPLATE_MAMAGEMENT_UPLOAD=\u4E0A\u4F20Excel\u6A21\u677F
 F_REPORT_DELETE=\u5220\u9664\u62A5\u8868
-F_DATAELEMENT_ADD=\u6DFB\u52A0\u6570\u636E\u5143
+F_DATAELEMENT_PUBLIC_ADD=\u6DFB\u52A0\u6570\u636E\u5143
 cancel=\u53D6\u6D88
 M_dhis-web-dashboard=\u4EEA\u8868\u76D8
 M_dhis-web-dashboard-integration=\u7EFC\u5408\u4EEA\u8868\u76D8