public void changePermissions(final IObject iObject, final Permissions perms) { final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); copy.getDetails().setPermissions(perms); getSecuritySystem().doAction(copy, new SecureAction(){ public <T extends IObject> T updateObject(T obj) { update.flush(); return null; } }); }
public void changePermissions(final IObject iObject, final Permissions perms) {  final LocalUpdate update = iUpdate; final EventContext ec = getSecuritySystem().getEventContext(); final boolean isAdmin = ec.isCurrentUserAdmin();  getSecuritySystem().runAsAdmin(new AdminAction(){ public void runAsAdmin() { IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); if (isAdmin || ec.getCurrentUserId().equals( copy.getDetails().getOwner().getId())) { copy.getDetails().setPermissions(perms); update.flush(); } else { throw new SecurityViolation("Cannot change permissions for:"+ copy); } } }); }
    public void changePermissions(final IObject iObject, final Permissions perms)    {    	final LocalUpdate update = iUpdate;    	final IObject copy = iQuery.get(iObject.getClass(), iObject.getId());    	copy.getDetails().setPermissions(perms);    	getSecuritySystem().doAction(copy, new SecureAction(){    		public <T extends IObject> T updateObject(T obj) {    			update.flush();    			return null;    		}    	});    }