Class AbstractCompiledPermissions
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authorization.AbstractCompiledPermissions
-
- All Implemented Interfaces:
CompiledPermissions
public abstract class AbstractCompiledPermissions extends Object implements CompiledPermissions
AbstractCompiledPermissions...
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractCompiledPermissions.ResultResult of permission (and optionally privilege) evaluation for a given path.
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.core.security.authorization.CompiledPermissions
NO_PERMISSION
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCompiledPermissions()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractCompiledPermissions.ResultbuildRepositoryResult()Retrieve the result for repository level operations.protected abstract AbstractCompiledPermissions.ResultbuildResult(Path absPath)Retrieve the result for the specified path.booleancanReadAll()Returnstrueif READ permission is granted everywhere.protected voidclearCache()Removes all entries from the cache.voidclose()Indicate to thisCompiledPermissionsobject that it is not used any more.protected abstract PrivilegeManagerImplgetPrivilegeManagerImpl()Retrieve the privilege manager.intgetPrivileges(Path absPath)Returns thePrivilegebits granted by the underlying policy if the givenabsPath.Set<Privilege>getPrivilegeSet(Path absPath)Returns thePrivileges granted by the underlying policy at the givenabsPath.AbstractCompiledPermissions.ResultgetResult(Path absPath)booleangrants(Path absPath, int permissions)Returnstrueif the specified permissions are granted on the item identified by the givenpath.booleanhasPrivileges(Path absPath, Privilege... privileges)Returnstrueif the given privileges are granted at the specifiedabsPath.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.core.security.authorization.CompiledPermissions
canRead
-
-
-
-
Method Detail
-
getResult
public AbstractCompiledPermissions.Result getResult(Path absPath) throws RepositoryException
- Parameters:
absPath- Absolute path to return the result for.- Returns:
- the
Resultfor the giveabsPath. - Throws:
RepositoryException- if an error occurs.
-
buildResult
protected abstract AbstractCompiledPermissions.Result buildResult(Path absPath) throws RepositoryException
Retrieve the result for the specified path.- Parameters:
absPath- Absolute path to build the result for.- Returns:
- Result for the specified
absPath. - Throws:
RepositoryException- If an error occurs.
-
buildRepositoryResult
protected abstract AbstractCompiledPermissions.Result buildRepositoryResult() throws RepositoryException
Retrieve the result for repository level operations.- Returns:
- The result instance for those permissions and privileges granted for repository level operations.
- Throws:
RepositoryException
-
getPrivilegeManagerImpl
protected abstract PrivilegeManagerImpl getPrivilegeManagerImpl() throws RepositoryException
Retrieve the privilege manager.- Returns:
- An instance of privilege manager.
- Throws:
RepositoryException- If an error occurs.
-
clearCache
protected void clearCache()
Removes all entries from the cache.
-
close
public void close()
Description copied from interface:CompiledPermissionsIndicate to thisCompiledPermissionsobject that it is not used any more.- Specified by:
closein interfaceCompiledPermissions- See Also:
CompiledPermissions.close()
-
grants
public boolean grants(Path absPath, int permissions) throws RepositoryException
Description copied from interface:CompiledPermissionsReturnstrueif the specified permissions are granted on the item identified by the givenpath.- Specified by:
grantsin interfaceCompiledPermissions- Parameters:
absPath- 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 byPermissionencoded as a bitmask value- Returns:
trueif the specified permissions are granted,falseotherwise.- Throws:
RepositoryException- if an error occurs.- See Also:
CompiledPermissions.grants(Path, int)
-
getPrivileges
public int getPrivileges(Path absPath) throws RepositoryException
Description copied from interface:CompiledPermissionsReturns thePrivilegebits granted by the underlying policy if the givenabsPath.- Specified by:
getPrivilegesin interfaceCompiledPermissions- Parameters:
absPath- Absolute path to aNode.- Returns:
- the granted privileges at
absPath. - Throws:
RepositoryException- if an error occurs- See Also:
CompiledPermissions.getPrivileges(Path)
-
hasPrivileges
public boolean hasPrivileges(Path absPath, Privilege... privileges) throws RepositoryException
Description copied from interface:CompiledPermissionsReturnstrueif the given privileges are granted at the specifiedabsPath.- Specified by:
hasPrivilegesin interfaceCompiledPermissions- Returns:
trueif the given privileges are granted at the specifiedabsPath.- Throws:
RepositoryException- See Also:
CompiledPermissions.hasPrivileges(org.apache.jackrabbit.spi.Path, javax.jcr.security.Privilege[])
-
getPrivilegeSet
public Set<Privilege> getPrivilegeSet(Path absPath) throws RepositoryException
Description copied from interface:CompiledPermissionsReturns thePrivileges granted by the underlying policy at the givenabsPath.- Specified by:
getPrivilegeSetin interfaceCompiledPermissions- Parameters:
absPath- Absolute path to aNode.- Returns:
- the granted privileges at
absPath. - Throws:
RepositoryException- if an error occurs- See Also:
CompiledPermissions.getPrivilegeSet(Path)
-
canReadAll
public boolean canReadAll() throws RepositoryExceptionDescription copied from interface:CompiledPermissionsReturnstrueif READ permission is granted everywhere. This method acts as shortcut forCompiledPermissions.grants(Path, int)where permissions isPermission.READand allows to shorten the evaluation time given the fact that a check for READ permission is considered to be the most frequent test.- Specified by:
canReadAllin interfaceCompiledPermissions- Returns:
trueif the READ permission is granted everywhere.- Throws:
RepositoryException- if an error occurs- See Also:
CompiledPermissions.canReadAll()
-
-