@Override protected void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException { log.debug("checkValidNodePath({})", absPath); super.checkValidNodePath(absPath); }
/** * @see javax.jcr.security.AccessControlManager#getPrivileges(String) */ public Privilege[] getPrivileges(String absPath) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); Set<Privilege> privs = compiledPermissions.getPrivilegeSet(getPath(absPath)); return privs.toArray(new Privilege[privs.size()]); }
/** * @see javax.jcr.security.AccessControlManager#getPrivileges(String) */ public Privilege[] getPrivileges(String absPath) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); Set<Privilege> privs = compiledPermissions.getPrivilegeSet(getPath(absPath)); return privs.toArray(new Privilege[privs.size()]); }
/** * @see javax.jcr.security.AccessControlManager#hasPrivileges(String, Privilege[]) */ public boolean hasPrivileges(String absPath, Privilege[] privileges) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); if (privileges == null || privileges.length == 0) { // null or empty privilege array -> return true log.debug("No privileges passed -> allowed."); return true; } else { Path p = getPath(absPath); return compiledPermissions.hasPrivileges(p, privileges); } }
/** * @see javax.jcr.security.AccessControlManager#hasPrivileges(String, Privilege[]) */ public boolean hasPrivileges(String absPath, Privilege[] privileges) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); if (privileges == null || privileges.length == 0) { // null or empty privilege array -> return true log.debug("No privileges passed -> allowed."); return true; } else { Path p = getPath(absPath); return compiledPermissions.hasPrivileges(p, privileges); } }
/** * @see AbstractAccessControlManager#checkPermission(String,int) */ @Override protected void checkPermission(String absPath, int permission) throws AccessDeniedException, RepositoryException { checkValidNodePath(absPath); Path p = getPath(absPath); if (!compiledPermissions.grants(p, permission)) { throw new AccessDeniedException("Access denied at " + absPath); } }
/** * @see AbstractAccessControlManager#checkPermission(String,int) */ @Override protected void checkPermission(String absPath, int permission) throws AccessDeniedException, RepositoryException { checkValidNodePath(absPath); Path p = getPath(absPath); if (!compiledPermissions.grants(p, permission)) { throw new AccessDeniedException("Access denied at " + absPath); } }
/** * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlManager#getPrivileges(String, Set) */ public Privilege[] getPrivileges(String absPath, Set<Principal> principals) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); checkPermission(absPath, Permission.READ_AC); CompiledPermissions perms = acProvider.compilePermissions(principals); try { Set<Privilege> privs = perms.getPrivilegeSet(getPath(absPath)); return privs.toArray(new Privilege[privs.size()]); } finally { perms.close(); } }
/** * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlManager#getPrivileges(String, Set) */ public Privilege[] getPrivileges(String absPath, Set<Principal> principals) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); checkPermission(absPath, Permission.READ_AC); CompiledPermissions perms = acProvider.compilePermissions(principals); try { Set<Privilege> privs = perms.getPrivilegeSet(getPath(absPath)); return privs.toArray(new Privilege[privs.size()]); } finally { perms.close(); } }
/** * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlManager#hasPrivileges(String, Set, Privilege[]) */ public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); checkPermission(absPath, Permission.READ_AC); if (privileges == null || privileges.length == 0) { // null or empty privilege array -> return true log.debug("No privileges passed -> allowed."); return true; } else { Path p = getPath(absPath); CompiledPermissions perms = acProvider.compilePermissions(principals); try { return perms.hasPrivileges(p, privileges); } finally { perms.close(); } } }
/** * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlManager#hasPrivileges(String, Set, Privilege[]) */ public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws PathNotFoundException, RepositoryException { checkInitialized(); checkValidNodePath(absPath); checkPermission(absPath, Permission.READ_AC); if (privileges == null || privileges.length == 0) { // null or empty privilege array -> return true log.debug("No privileges passed -> allowed."); return true; } else { Path p = getPath(absPath); CompiledPermissions perms = acProvider.compilePermissions(principals); try { return perms.hasPrivileges(p, privileges); } finally { perms.close(); } } }