=== 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-01-18 15:54:53 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java 2013-03-11 17:29:55 +0000 @@ -127,7 +127,7 @@ JacksonUtils.toJson( response.getOutputStream(), sharing ); } - @RequestMapping(value = "", method = RequestMethod.POST, consumes = "application/json") + @RequestMapping(value = "", method = { RequestMethod.POST, RequestMethod.PUT }, consumes = "application/json") public void setSharing( @RequestParam String type, @RequestParam String id, HttpServletResponse response, HttpServletRequest request ) throws IOException { BaseIdentifiableObject object = (BaseIdentifiableObject) manager.get( SharingUtils.classForType( type ), id ); @@ -145,8 +145,8 @@ Sharing sharing = JacksonUtils.fromJson( request.getInputStream(), Sharing.class ); - // just ignore publicAccess if user is not allowed to make objects public, this should be hidden - // in the UI. + // Ignore publicAccess if user is not allowed to make objects public + if ( SharingUtils.canCreatePublic( currentUserService.getCurrentUser(), object ) ) { object.setPublicAccess( sharing.getObject().getPublicAccess() ); @@ -184,6 +184,8 @@ } manager.update( object ); + + ContextUtils.okResponse( response, "Access control set" ); } @RequestMapping( value = "/search", produces = { "application/json", "text/*" } )