← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14377: Added public/private authorities for trackedEntityAttribute (also used for group)

 

------------------------------------------------------------
revno: 14377
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-24 20:24:58 +0100
message:
  Added public/private authorities for trackedEntityAttribute (also used for group)
modified:
  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-program/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.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-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	2014-03-24 19:15:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-03-24 19:24:58 +0000
@@ -568,6 +568,7 @@
         executeSql( "UPDATE userroleauthorities SET authority='F_SQLVIEW_PUBLIC_ADD' WHERE authority='F_SQLVIEW_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_OPTIONSET_PUBLIC_ADD' WHERE authority='F_OPTIONSET_ADD'" );
         executeSql( "UPDATE userroleauthorities SET authority='F_VALIDATIONRULEGROUP_PUBLIC_ADD' WHERE authority='F_VALIDATIONRULEGROUP_ADD'" );
+        executeSql( "UPDATE userroleauthorities SET authority='F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD' WHERE authority='F_TRACKED_ENTITY_ATTRIBUTE_ADD'" );
 
         // remove unused authorities
         executeSql( "DELETE FROM userroleauthorities WHERE authority='F_CONCEPT_UPDATE'" );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml	2014-03-24 19:16:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml	2014-03-24 19:24:58 +0000
@@ -62,27 +62,19 @@
       <param name="page">/dhis-web-maintenance-program/updateRelationshipTypeForm.vm</param>
       <param name="javascripts">javascript/relationship.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
-    <action name="updateRelationshipType"
-      class="org.hisp.dhis.trackedentity.action.relationship.UpdateRelationshipTypeAction">
-      <result name="success" type="redirect">relationshipType.action
-      </result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+    <action name="updateRelationshipType" class="org.hisp.dhis.trackedentity.action.relationship.UpdateRelationshipTypeAction">
+      <result name="success" type="redirect">relationshipType.action</result>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="validateRelationshipType"
       class="org.hisp.dhis.trackedentity.action.relationship.ValidateRelationshipTypeAction">
-      <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="input" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseInput.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>
+      <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
 
@@ -91,129 +83,97 @@
     <action name="attribute"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributeListAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">
-        /dhis-web-maintenance-program/attribute.vm
-      </param>
+      <param name="page">/dhis-web-maintenance-program/attribute.vm</param>
       <param name="menu">/dhis-web-maintenance-program/menu.vm</param>
       <param name="javascripts">javascript/attribute.js</param>
     </action>
 
-    <action name="getAttribute"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributeAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm
-      </result>
-      <param name="onExceptionReturn">plainTextError</param>
-    </action>
-
-    <action name="getAttributes"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributeListAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonTrackedEntityAttributes.vm
-      </result>
-      <param name="onExceptionReturn">plainTextError</param>
-    </action>
-
-    <action name="getAttributeWithoutGroup"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributesWithoutGroupAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonTrackedEntityAttributes.vm
-      </result>
-      <param name="onExceptionReturn">plainTextError</param>
-    </action>
-
-    <action name="removeAttribute"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.RemoveAttributeAction">
-      <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>
+    <action name="getAttribute" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributeAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
+    <action name="getAttributes" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributeListAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonTrackedEntityAttributes.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
+    <action name="getAttributeWithoutGroup" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.GetAttributesWithoutGroupAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonTrackedEntityAttributes.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
+    <action name="removeAttribute" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.RemoveAttributeAction">
+      <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="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_DELETE</param>
     </action>
 
-    <action name="addAttribute"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.AddAttributeAction">
-      <result name="success" type="redirect">attribute.action
-      </result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+    <action name="addAttribute" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.AddAttributeAction">
+      <result name="success" type="redirect">attribute.action</result>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
-    <action name="showAddAttributeForm"
-      class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddAttributeFormAction">
+    <action name="showAddAttributeForm" class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAddAttributeFormAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">
-        /dhis-web-maintenance-program/addAttributeForm.vm
-      </param>
+      <param name="page">/dhis-web-maintenance-program/addAttributeForm.vm</param>
       <param name="javascripts">javascript/attribute.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateAttributeForm"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowUpdateAttributeAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">
-        /dhis-web-maintenance-program/updateAttibuteForm.vm
-      </param>
+      <param name="page">/dhis-web-maintenance-program/updateAttibuteForm.vm</param>
       <param name="javascripts">javascript/attribute.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="updateAttribute"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.UpdateAttributeAction">
-      <result name="success" type="redirect">attribute.action
-      </result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <result name="success" type="redirect">attribute.action</result>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="validateAttribute"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ValidateAttributeAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseSuccess.vm
-      </result>
-      <result name="input" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseInput.vm
-      </result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
 
     <action name="attributeVisitSchedule"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAttributeVisitScheduleFormAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">
-        /dhis-web-maintenance-program/attributeVisitSchedule.vm
-      </param>
+      <param name="page">/dhis-web-maintenance-program/attributeVisitSchedule.vm</param>
       <param name="menu">/dhis-web-maintenance-program/menu.vm</param>
       <param name="javascripts">javascript/attribute.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="saveAttributeVisitSchedule"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.SaveAttributeVisitScheduleAction">
       <result name="success" type="redirect">index.action</result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="attributeInListNoProgram"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.ShowAttributeInListNoProgramAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">
-        /dhis-web-maintenance-program/attributeInListNoProgram.vm
-      </param>
+      <param name="page">/dhis-web-maintenance-program/attributeInListNoProgram.vm</param>
       <param name="menu">/dhis-web-maintenance-program/menu.vm</param>
       <param name="javascripts">javascript/attribute.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="saveAttributeInListNoProgram"
       class="org.hisp.dhis.trackedentity.action.trackedentityattribute.SaveAttributeInListNoProgramAction">
       <result name="success" type="redirect">index.action</result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <!-- Program -->
@@ -658,17 +618,14 @@
 
     <action name="removeAttributeGroup"
       class="org.hisp.dhis.trackedentity.action.trackedentityattributegroup.RemoveAttributeGroupAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseSuccess.vm
-      </result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_DELETE</param>
     </action>
 
     <action name="addAttributeGroup"
       class="org.hisp.dhis.trackedentity.action.trackedentityattributegroup.AddAttributeGroupAction">
-      <result name="success" type="redirect">attributeGroup.action
-      </result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <result name="success" type="redirect">attributeGroup.action</result>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="showAddAttributeGroupForm" class="org.hisp.dhis.trackedentity.action.NoAction">
@@ -676,7 +633,7 @@
       <param name="page">/dhis-web-maintenance-program/addAttributeGroupForm.vm</param>
       <param name="javascripts">javascript/attributeGroup.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateAttributeGroupForm"
@@ -685,27 +642,20 @@
       <param name="page">/dhis-web-maintenance-program/updateAttibuteGroupForm.vm</param>
       <param name="javascripts">javascript/attributeGroup.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="updateAttributeGroup"
       class="org.hisp.dhis.trackedentity.action.trackedentityattributegroup.UpdateAttributeGroupAction">
-      <result name="success" type="redirect">attributeGroup.action
-      </result>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <result name="success" type="redirect">attributeGroup.action</result>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="validateAttributeGroup"
       class="org.hisp.dhis.trackedentity.action.trackedentityattributegroup.ValidateAttributeGroupAction">
-      <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="input" type="velocity-json">
-        /dhis-web-commons/ajax/jsonResponseInput.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>
+      <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
 
@@ -715,13 +665,12 @@
       <param name="page">/dhis-web-maintenance-program/sortAttributeGroupForm.vm</param>
       <param name="javascripts">javascript/attributeGroup.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_ADD</param>
+      <param name="anyAuthorities">F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD, F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD</param>
     </action>
 
     <action name="saveAttributeGroupSortOrder"
       class="org.hisp.dhis.trackedentity.action.trackedentityattributegroup.SaveAttributeGroupSortOrderAction">
-      <result name="success" type="redirect">attributeGroup.action
-      </result>
+      <result name="success" type="redirect">attributeGroup.action</result>
     </action>
 
     <!-- Case Aggregation Condition -->

=== 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	2014-03-24 19:15:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2014-03-24 19:24:58 +0000
@@ -143,8 +143,9 @@
 F_ORGANISATION_REGISTRATION=Organisation Unit Registration
 F_TRACKED_ENTITY_REMOVE_EMPTY_EVENTS=Remove Empty Tracked Entity Events
 F_ACCESS_TRACKED_ENTITY_ATTRIBUTES = View and Search Tracked Entity Attributes and Identifiers
-F_ALLOW_EDIT_TRACKED_ENTITY_ATTRIBUTES = Add and Edit Tracked Entity Attributes
-F_TRACKED_ENTITY_ATTRIBUTE_ADD=Add/Update Tracked Entity Attribute
+F_ALLOW_EDIT_TRACKED_ENTITY_ATTRIBUTES = Add/Update Tracked Entity Attributes
+F_TRACKED_ENTITY_ATTRIBUTE_PUBLIC_ADD=Add/Update Public Tracked Entity Attribute
+F_TRACKED_ENTITY_ATTRIBUTE_PRIVATE_ADD=Add/Update Private Tracked Entity Attribute
 F_TRACKED_ENTITY_ATTRIBUTE_DELETE=Delete Tracked Entity Attribute
 F_TRACKED_ENTITY_ATTRIBUTEVALUE_ADD=Add Tracked Entity Attribute Value
 F_ADD_PROGRAM_INDICATOR = Add/Update Program Indicator