if (!document.getPermissions().getOwner().equals(user.getName()) && !manager.hasAdminPrivileges(user))
if (!(document.getPermissions().getOwner().equals(user.getName()) || manager.hasAdminPrivileges(user)))
	public void setPermissions(Resource resource, Permission perm) throws XMLDBException {		org.exist.security.SecurityManager manager = pool.getSecurityManager();		DBBroker broker = null;		try {			broker = pool.get();			DocumentImpl document = ((LocalXMLResource) resource).getDocument();			if (!document.getPermissions().getOwner().equals(user.getName())				&& !manager.hasAdminPrivileges(user))				throw new XMLDBException(					ErrorCodes.PERMISSION_DENIED,					"you are not the owner of this resource");			document.setPermissions(perm);			broker.saveCollection(collection.getCollection());		} catch (EXistException e) {			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);		} catch (PermissionDeniedException e) {			throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, e);		} finally {			pool.release(broker);		}	}