public abstract class AbstractCompiledPermissions extends Object implements CompiledPermissions
AbstractCompiledPermissions...| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractCompiledPermissions.Result
Result of permission (and optionally privilege) evaluation for a given path.
|
NO_PERMISSION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCompiledPermissions() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract AbstractCompiledPermissions.Result |
buildRepositoryResult()
Retrieve the result for repository level operations.
|
protected abstract AbstractCompiledPermissions.Result |
buildResult(Path absPath)
Retrieve the result for the specified path.
|
boolean |
canReadAll()
Returns
true if READ permission is granted everywhere. |
protected void |
clearCache()
Removes all entries from the cache.
|
void |
close()
Indicate to this
CompiledPermissions object that it is
not used any more. |
protected abstract PrivilegeManagerImpl |
getPrivilegeManagerImpl()
Retrieve the privilege manager.
|
int |
getPrivileges(Path absPath)
Returns the
Privilege bits granted by the underlying policy
if the given absPath. |
Set<Privilege> |
getPrivilegeSet(Path absPath)
Returns the
Privileges granted by the underlying policy
at the given absPath. |
AbstractCompiledPermissions.Result |
getResult(Path absPath) |
boolean |
grants(Path absPath,
int permissions)
Returns
true if the specified permissions are granted
on the item identified by the given path. |
boolean |
hasPrivileges(Path absPath,
Privilege... privileges)
Returns
true if the given privileges are granted at the
specified absPath. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanReadpublic AbstractCompiledPermissions.Result getResult(Path absPath) throws RepositoryException
absPath - Absolute path to return the result for.Result for the give absPath.RepositoryException - if an error occurs.protected abstract AbstractCompiledPermissions.Result buildResult(Path absPath) throws RepositoryException
absPath - Absolute path to build the result for.absPath.RepositoryException - If an error occurs.protected abstract AbstractCompiledPermissions.Result buildRepositoryResult() throws RepositoryException
RepositoryExceptionprotected abstract PrivilegeManagerImpl getPrivilegeManagerImpl() throws RepositoryException
RepositoryException - If an error occurs.protected void clearCache()
public void close()
CompiledPermissionsCompiledPermissions object that it is
not used any more.close in interface CompiledPermissionsCompiledPermissions.close()public boolean grants(Path absPath, int permissions) throws RepositoryException
CompiledPermissionstrue if the specified permissions are granted
on the item identified by the given path.grants in interface CompiledPermissionsabsPath - Absolute path pointing to an item. If the item does
not exist yet (asking for 'add-node' and 'set-property' permission),
it's direct ancestor must exist.permissions - A combination of one or more of permission constants
defined by Permission encoded as a bitmask valuetrue if the specified permissions are granted,
false otherwise.RepositoryException - if an error occurs.CompiledPermissions.grants(Path, int)public int getPrivileges(Path absPath) throws RepositoryException
CompiledPermissionsPrivilege bits granted by the underlying policy
if the given absPath.getPrivileges in interface CompiledPermissionsabsPath - Absolute path to a Node.absPath.RepositoryException - if an error occursCompiledPermissions.getPrivileges(Path)public boolean hasPrivileges(Path absPath, Privilege... privileges) throws RepositoryException
CompiledPermissionstrue if the given privileges are granted at the
specified absPath.hasPrivileges in interface CompiledPermissionstrue if the given privileges are granted at the
specified absPath.RepositoryExceptionCompiledPermissions.hasPrivileges(org.apache.jackrabbit.spi.Path, javax.jcr.security.Privilege[])public Set<Privilege> getPrivilegeSet(Path absPath) throws RepositoryException
CompiledPermissionsPrivileges granted by the underlying policy
at the given absPath.getPrivilegeSet in interface CompiledPermissionsabsPath - Absolute path to a Node.absPath.RepositoryException - if an error occursCompiledPermissions.getPrivilegeSet(Path)public boolean canReadAll()
throws RepositoryException
CompiledPermissionstrue if READ permission is granted everywhere.
This method acts as shortcut for CompiledPermissions.grants(Path, int) where
permissions is Permission.READ and allows to shorten the
evaluation time given the fact that a check for READ permission is
considered to be the most frequent test.canReadAll in interface CompiledPermissionstrue if the READ permission is granted everywhere.RepositoryException - if an error occursCompiledPermissions.canReadAll()Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.