← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14022: sharing for categories, wip

 

------------------------------------------------------------
revno: 14022
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-02-14 18:42:10 +0700
message:
  sharing for categories, wip
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java
  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-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-api/src/main/java/org/hisp/dhis/common/SharingUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java	2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java	2014-02-14 11:42:10 +0000
@@ -31,7 +31,12 @@
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.dashboard.Dashboard;
 import org.hisp.dhis.datadictionary.DataDictionary;
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategory;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.indicator.Indicator;
@@ -102,6 +107,11 @@
         addType( DataSet.class, "dataSet", null, "F_DATASET_PUBLIC_ADD", "F_DATASET_PRIVATE_ADD" );
         addType( DataDictionary.class, "dataDictionary", null, "F_DATADICTIONARY_PUBLIC_ADD", "F_DATADICTIONARY_PRIVATE_ADD" );
         addType( DataElement.class, "dataElement", null, "F_DATAELEMENT_PUBLIC_ADD", "F_DATAELEMENT_PRIVATE_ADD" );
+        addType( DataElementCategory.class, "category", null, "F_CATEGORY_PUBLIC_ADD", "F_CATEGORY_PRIVATE_ADD" );
+        addType( DataElementCategoryOption.class, "categoryOption", null, "F_CATEGORY_OPTION_PUBLIC_ADD", "F_CATEGORY_OPTION_PRIVATE_ADD" );
+        addType( CategoryOptionGroup.class, "categoryOptionGroup", null, "F_CATEGORY_OPTION_GROUP_PUBLIC_ADD", "F_CATEGORY_OPTION_GROUP_PRIVATE_ADD" );
+        addType( CategoryOptionGroupSet.class, "categoryOptionGroupSet", null, "F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD", "F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD" );
+        addType( DataElementCategoryCombo.class, "categoryCombo", null, "F_CATEGORY_COMBO_PUBLIC_ADD", "F_CATEGORY_COMBO_PRIVATE_ADD" );
         addType( OrganisationUnitGroup.class, "organisationUnitGroup", null, "F_ORGUNITGROUP_PUBLIC_ADD", "F_ORGUNITGROUP_PRIVATE_ADD" );
         addType( Indicator.class, "indicator", null, "F_INDICATOR_PUBLIC_ADD", "F_INDICATOR_PRIVATE_ADD" );
         addType( IndicatorGroup.class, "indicatorGroup", null, "F_INDICATORGROUP_PUBLIC_ADD", "F_INDICATORGROUP_PRIVATE_ADD" );

=== 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	2014-02-14 11:24:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2014-02-14 11:42:10 +0000
@@ -709,7 +709,7 @@
       class="org.hisp.dhis.dd.action.categoryoptiongroup.AddCategoryOptionGroupAction">
       <result name="success" type="redirect">categoryOptionGroup.action
       </result>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_PRIVATE_ADD</param>
     </action>
 
     <action name="showAddCategoryOptionGroupForm" class="org.hisp.dhis.dd.action.categoryoptiongroup.ShowAddCategoryOptionGroupAction">
@@ -717,7 +717,7 @@
       <param name="page">/dhis-web-maintenance-datadictionary/addCategoryOptionGroupForm.vm</param>
       <param name="javascripts">javascript/categoryOptionGroup.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateCategoryOptionGroupForm"
@@ -726,14 +726,14 @@
       <param name="page">/dhis-web-maintenance-datadictionary/updateCategoryOptionGroupForm.vm</param>
       <param name="javascripts">javascript/categoryOptionGroup.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_UPDATE</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_PRIVATE_ADD</param>
     </action>
 
     <action name="updateCategoryOptionGroup"
       class="org.hisp.dhis.dd.action.categoryoptiongroup.UpdateCategoryOptionGroupAction">
       <result name="success" type="redirect">categoryOptionGroup.action
       </result>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_UPDATE</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_PRIVATE_ADD</param>
     </action>
 
     <action name="validateCategoryOptionGroup"
@@ -762,25 +762,20 @@
 
     <action name="getCategoryOptionGroupSet"
       class="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetAction">
-      <result name="success" type="velocity-json">
-        /dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm
-      </result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
 
     <action name="removeCategoryOptionGroupSet"
       class="org.hisp.dhis.dd.action.categoryoptiongroupset.RemoveCategoryOptionGroupSetAction">
-      <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_CATEGORY_OPTION_GROUP_SET_DELETE</param>
     </action>
 
     <action name="addCategoryOptionGroupSet"
       class="org.hisp.dhis.dd.action.categoryoptiongroupset.AddCategoryOptionGroupSetAction">
-      <result name="success" type="redirect">categoryOptionGroupSet.action
-      </result>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_ADD</param>
+      <result name="success" type="redirect">categoryOptionGroupSet.action</result>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD</param>
     </action>
 
     <action name="showAddCategoryOptionGroupSetForm"
@@ -789,7 +784,7 @@
       <param name="page">/dhis-web-maintenance-datadictionary/addCategoryOptionGroupSetForm.vm</param>
       <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_ADD</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD</param>
     </action>
 
     <action name="showUpdateCategoryOptionGroupSetForm"
@@ -798,27 +793,20 @@
       <param name="page">/dhis-web-maintenance-datadictionary/updateCategoryOptionGroupSetForm.vm</param>
       <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
       <param name="stylesheets">style/basic.css</param>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_UPDATE</param>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD</param>
     </action>
 
     <action name="updateCategoryOptionGroupSet"
       class="org.hisp.dhis.dd.action.categoryoptiongroupset.UpdateCategoryOptionGroupSetAction">
-      <result name="success" type="redirect">categoryOptionGroupSet.action
-      </result>
-      <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_UPDATE</param>
+      <result name="success" type="redirect">categoryOptionGroupSet.action</result>
+      <param name="anyAuthorities">F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD, F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD</param>
     </action>
 
     <action name="validateCategoryOptionGroupSet"
       class="org.hisp.dhis.dd.action.categoryoptiongroupset.ValidateCategoryOptionGroupSetAction">
-      <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>
 

=== 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-02-14 11:24:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2014-02-14 11:42:10 +0000
@@ -46,15 +46,21 @@
 F_DATAELEMENT_PUBLIC_ADD=Add/Update Public Data Element
 F_DATAELEMENT_PRIVATE_ADD=Add/Update Private Data Element
 F_DATAELEMENT_DELETE=Delete Data Element
-F_CATEGORY_PUBLIC_ADD=Add/Update Public Data Element Categories
-F_CATEGORY_PRIVATE_ADD=Add/Update Private Data Element Categories
-F_CATEGORY_DELETE=Delete Data Element Categories
-F_CATEGORY_OPTION_PUBLIC_ADD=Add/Update Public Data Element Category Options
-F_CATEGORY_OPTION_PRIVATE_ADD=Add/Update Private Data Element Category Options
-F_CATEGORY_OPTION_DELETE=Add/Update Public Data Element Category Options
-F_CATEGORY_COMBO_PUBLIC_ADD=Add/Update Public Data Element Category Combos
-F_CATEGORY_COMBO_PRIVATE_ADD=Add/Update Private Data Element Category Combos
-F_CATEGORY_COMBO_DELETE=Delete Data Element Category Combos
+F_CATEGORY_PUBLIC_ADD=Add/Update Public Data Element Category
+F_CATEGORY_PRIVATE_ADD=Add/Update Private Data Element Category
+F_CATEGORY_DELETE=Delete Data Element Category
+F_CATEGORY_OPTION_PUBLIC_ADD=Add/Update Public Data Element Category Option
+F_CATEGORY_OPTION_PRIVATE_ADD=Add/Update Private Data Element Category Option
+F_CATEGORY_OPTION_DELETE=Add/Update Public Data Element Category Option
+F_CATEGORY_COMBO_PUBLIC_ADD=Add/Update Public Data Element Category Combo
+F_CATEGORY_COMBO_PRIVATE_ADD=Add/Update Private Data Element Category Combo
+F_CATEGORY_COMBO_DELETE=Delete Data Element Category Combo
+F_CATEGORY_OPTION_GROUP_PUBLIC_ADD=Add/Update Public Category Option Group
+F_CATEGORY_OPTION_GROUP_PRIVATE_ADD=Add/Update Private Category Option Group
+F_CATEGORY_OPTION_GROUP_DELETE = Delete Category Option Group
+F_CATEGORY_OPTION_GROUP_SET_PUBLIC_ADD=Add/Update Public Category Option Group Set
+F_CATEGORY_OPTION_GROUP_SET_PRIVATE_ADD=Add/Update Private Category Option Group Set
+F_CATEGORY_OPTION_GROUP_SET_DELETE = Delete Category Option Group Set
 F_DATAELEMENTGROUP_PUBLIC_ADD=Add/Update Public Data Element Groups
 F_DATAELEMENTGROUP_PRIVATE_ADD=Add/Update Private Data Element Groups
 F_DATAELEMENTGROUP_DELETE=Delete Data Element Groups
@@ -66,12 +72,6 @@
 F_DATADICTIONARY_DELETE=Delete Data Dictionary
 F_DATAELEMENT_MINMAX_ADD=Add/Update Min/max rule
 F_DATAELEMENT_MINMAX_DELETE=Delete Min/max rule
-F_CATEGORY_OPTION_GROUP_DELETE = Delete Category Option Group
-F_CATEGORY_OPTION_GROUP_ADD = Add Category Option Group
-F_CATEGORY_OPTION_GROUP_UPDATE = Update Category Option Group
-F_CATEGORY_OPTION_GROUP_SET_DELETE = Delete Category Option Group Set
-F_CATEGORY_OPTION_GROUP_SET_ADD = Add Category Option Group Set
-F_CATEGORY_OPTION_GROUP_SET_UPDATE = Update Category Option Group Set
 F_DATASET_PUBLIC_ADD=Add/Update Public Data Set
 F_DATASET_PRIVATE_ADD=Add/Update Private Data Set
 F_DATASET_DELETE=Delete Data Set