if(!doc.getPermissions().validate(user, Permission.READ)) throw new PermissionDeniedException("Insufficient privileges to read resource");
	public String hasUserLock(User user, String path) throws Exception {		DBBroker broker = null;		try {			broker = brokerPool.get(user);			DocumentImpl doc = (DocumentImpl) broker.getDocument(path);			if (doc == null)				throw new EXistException("Resource " + path + " not found");			User u = doc.getUserLock();			return u == null ? "" : u.getName();		} finally {			brokerPool.release(broker);		}	}