dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21760
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10393: show publicaccess=none if public sharing is disabled (sharing dialog)
------------------------------------------------------------
revno: 10393
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-22 12:16:10 +0700
message:
show publicaccess=none if public sharing is disabled (sharing dialog)
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java 2013-03-21 06:43:08 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java 2013-03-22 05:16:10 +0000
@@ -114,8 +114,18 @@
if ( sharing.getObject().getPublicAccess() == null )
{
- String rw = AccessStringHelper.newInstance().enable( AccessStringHelper.Permission.READ ).enable( AccessStringHelper.Permission.WRITE ).build();
- sharing.getObject().setPublicAccess( rw );
+ String access;
+
+ if ( SharingUtils.canCreatePublic( currentUserService.getCurrentUser(), type ) )
+ {
+ access = AccessStringHelper.newInstance().enable( AccessStringHelper.Permission.READ ).enable( AccessStringHelper.Permission.WRITE ).build();
+ }
+ else
+ {
+ access = AccessStringHelper.newInstance().build();
+ }
+
+ sharing.getObject().setPublicAccess( access );
}
else
{