← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19379: Approval: Assume public access if userid is null when checking categoryOption sharing.

 

------------------------------------------------------------
revno: 19379
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Sat 2015-06-13 09:12:22 -0400
message:
  Approval: Assume public access if userid is null when checking categoryOption sharing.
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java


--
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/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2015-06-01 23:57:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2015-06-13 13:12:22 +0000
@@ -421,7 +421,7 @@
                 "where ( coo.categoryoptionid is null or ous.organisationunitid is not null " + testAncestors + ")" +
                 ( attributeOptionCombo == null ? "" : " and cocco.categoryoptioncomboid = " + attributeOptionCombo.getId() ) +
                 ( isSuperUser || user == null ? "" :
-                    " and ( co.publicaccess is null or left(co.publicaccess, 1) = 'r' or co.userid = " + user.getId() + " or exists ( " +
+                    " and ( co.publicaccess is null or left(co.publicaccess, 1) = 'r' or co.userid is null or co.userid = " + user.getId() + " or exists ( " +
                     "select 1 from dataelementcategoryoptionusergroupaccesses couga " +
                     "left join usergroupaccess uga on uga.usergroupaccessid = couga.usergroupaccessid " +
                     "left join usergroupmembers ugm on ugm.usergroupid = uga.usergroupid " +