|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.security.AbstractAccessControlManager
org.apache.jackrabbit.core.security.DefaultAccessManager
public class DefaultAccessManager
The DefaultAccessManager controls access by evaluating access
control policies for the Subject attached to the
Session this manager has been built for.
Please note the following exceptional situations:
This manager allows all privileges for a particular item if
SystemPrincipal or
an AdminPrincipalWorkspaceAccessManager is defined.AccessControlProvider set to this AccessManager.
AccessManager,
AccessControlManager| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.core.security.AccessManager |
|---|
READ, REMOVE, WRITE |
| Constructor Summary | |
|---|---|
DefaultAccessManager()
|
|
| Method Summary | |
|---|---|
boolean |
canAccess(String workspaceName)
Determines whether the subject of the current context is granted access to the given workspace. |
boolean |
canRead(Path itemPath)
Determines whether the item at the specified absolute path can be read. |
protected void |
checkInitialized()
Check if this manager has been properly initialized. |
void |
checkPermission(ItemId id,
int permissions)
Determines whether the specified permissions are granted
on the item with the specified id (i.e. |
void |
checkPermission(Path absPath,
int permissions)
Determines whether the specified permissions are granted
on the item with the specified id (i.e. |
protected void |
checkPermission(String absPath,
int permission)
Check if the specified privileges are granted at absPath. |
protected void |
checkValidNodePath(String absPath)
Tests if the given absPath is absolute and points to an existing node. |
void |
close()
Close this access manager. |
JackrabbitAccessControlPolicy[] |
getApplicablePolicies(Principal principal)
|
AccessControlPolicyIterator |
getApplicablePolicies(String absPath)
Returns an empty iterator. |
AccessControlPolicy[] |
getEffectivePolicies(String absPath)
|
JackrabbitAccessControlPolicy[] |
getPolicies(Principal principal)
|
AccessControlPolicy[] |
getPolicies(String absPath)
Returns null. |
protected PrivilegeRegistry |
getPrivilegeRegistry()
|
Privilege[] |
getPrivileges(String absPath)
|
Privilege[] |
getPrivileges(String absPath,
Set<Principal> principals)
|
boolean |
hasPrivileges(String absPath,
Privilege[] privileges)
|
boolean |
hasPrivileges(String absPath,
Set<Principal> principals,
Privilege[] privileges)
|
void |
init(AMContext amContext)
Initialize this access manager. |
void |
init(AMContext amContext,
AccessControlProvider acProvider,
WorkspaceAccessManager wspAccessManager)
Initialize this access manager. |
boolean |
isGranted(ItemId id,
int actions)
Determines whether the specified permissions are granted
on the item with the specified id (i.e. |
boolean |
isGranted(Path absPath,
int permissions)
Determines whether the specified permissions are granted
on the item with the specified absPath (i.e. |
boolean |
isGranted(Path parentPath,
Name childName,
int permissions)
Determines whether the specified permissions are granted
on an item represented by the combination of the given
parentPath and childName (i.e. |
void |
removePolicy(String absPath,
AccessControlPolicy policy)
Always throws AccessControlException |
void |
setPolicy(String absPath,
AccessControlPolicy policy)
Always throws AccessControlException |
| Methods inherited from class org.apache.jackrabbit.core.security.AbstractAccessControlManager |
|---|
getSupportedPrivileges, privilegeFromName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultAccessManager()
| Method Detail |
|---|
public void init(AMContext amContext)
throws AccessDeniedException,
Exception
AccessManagerAccessDeniedException will
be thrown if the subject of the given context is not
granted access to the specified workspace.
init in interface AccessManageramContext - access manager context
AccessDeniedException - if the subject is not granted access
to the specified workspace.
Exception - if another error occursAccessManager.init(AMContext)
public void init(AMContext amContext,
AccessControlProvider acProvider,
WorkspaceAccessManager wspAccessManager)
throws AccessDeniedException,
Exception
AccessManagerAccessDeniedException will
be thrown if the subject of the given context is not
granted access to the specified workspace.
init in interface AccessManageramContext - access manager context.acProvider - The access control provider.wspAccessManager - The workspace access manager.
AccessDeniedException - if the subject is not granted access
to the specified workspace.
Exception - if another error occursAccessManager.init(AMContext, AccessControlProvider, WorkspaceAccessManager)
public void close()
throws Exception
AccessManager
close in interface AccessManagerException - if an error occursAccessManager.close()
public void checkPermission(ItemId id,
int permissions)
throws AccessDeniedException,
ItemNotFoundException,
RepositoryException
AccessManagerpermissions are granted
on the item with the specified id (i.e. the target item).
checkPermission in interface AccessManagerid - the id of the target itempermissions - A combination of one or more of the following constants
encoded as a bitmask value:
READWRITEREMOVEAccessDeniedException - if permission is denied
ItemNotFoundException - if the target item does not exist
RepositoryException - it an error occursAccessManager.checkPermission(ItemId, int)
public void checkPermission(Path absPath,
int permissions)
throws AccessDeniedException,
RepositoryException
AccessManagerpermissions are granted
on the item with the specified id (i.e. the target item).
checkPermission in interface AccessManagerabsPath - Path to an item.permissions - A combination of one or more of the
Permission
constants encoded as a bitmask value.
AccessDeniedException - if permission is denied
RepositoryException - it another error occursAccessManager.checkPermission(Path, int)
public boolean isGranted(ItemId id,
int actions)
throws ItemNotFoundException,
RepositoryException
AccessManagerpermissions are granted
on the item with the specified id (i.e. the target item).
isGranted in interface AccessManagerid - the id of the target itemactions - A combination of one or more of the following constants
encoded as a bitmask value:
READWRITEREMOVEtrue if permission is granted; otherwise false
ItemNotFoundException - if the target item does not exist
RepositoryException - if another error occursAccessManager.isGranted(ItemId, int)
public boolean isGranted(Path absPath,
int permissions)
throws RepositoryException
AccessManagerpermissions are granted
on the item with the specified absPath (i.e. the target
item, that may or may not yet exist).
isGranted in interface AccessManagerabsPath - the absolute path to testpermissions - A combination of one or more of the
Permission
constants encoded as a bitmask value.
true if the specified permissions are granted;
otherwise false.
RepositoryException - if an error occurs.AccessManager.isGranted(Path, int)
public boolean isGranted(Path parentPath,
Name childName,
int permissions)
throws RepositoryException
AccessManagerpermissions are granted
on an item represented by the combination of the given
parentPath and childName (i.e. the target
item, that may or may not yet exist).
isGranted in interface AccessManagerparentPath - Path to an existing parent node.childName - Name of the child item that may or may not exist yet.permissions - A combination of one or more of the
Permission
constants encoded as a bitmask value.
true if the specified permissions are granted;
otherwise false.
RepositoryException - if an error occurs.AccessManager.isGranted(Path, Name, int)
public boolean canRead(Path itemPath)
throws RepositoryException
AccessManager
canRead in interface AccessManageritemPath - Path to the item to be tested.s
true if the item can be read; otherwise false.
RepositoryException - if an error occurs.AccessManager.canRead(Path)
public boolean canAccess(String workspaceName)
throws RepositoryException
AccessManagerfalse, if no such workspace
exists.
canAccess in interface AccessManagerworkspaceName - name of workspace
true if the subject of the current context is
granted access to the given workspace; otherwise false.
RepositoryException - if an error occurs.AccessManager.canAccess(String)
public boolean hasPrivileges(String absPath,
Privilege[] privileges)
throws PathNotFoundException,
RepositoryException
hasPrivileges in interface AccessControlManagerPathNotFoundException
RepositoryExceptionAccessControlManager.hasPrivileges(String, Privilege[])
public Privilege[] getPrivileges(String absPath)
throws PathNotFoundException,
RepositoryException
getPrivileges in interface AccessControlManagerPathNotFoundException
RepositoryExceptionAccessControlManager.getPrivileges(String)
public AccessControlPolicy[] getPolicies(String absPath)
throws PathNotFoundException,
AccessDeniedException,
RepositoryException
AbstractAccessControlManagernull.
getPolicies in interface AccessControlManagergetPolicies in class AbstractAccessControlManagerabsPath - Path to an existing node.
null.
PathNotFoundException
AccessDeniedException
RepositoryExceptionAccessControlManager.getPolicies(String)
public AccessControlPolicy[] getEffectivePolicies(String absPath)
throws PathNotFoundException,
AccessDeniedException,
RepositoryException
getEffectivePolicies in interface AccessControlManagerPathNotFoundException
AccessDeniedException
RepositoryExceptionAccessControlManager.getEffectivePolicies(String)
public AccessControlPolicyIterator getApplicablePolicies(String absPath)
throws PathNotFoundException,
AccessDeniedException,
RepositoryException
AbstractAccessControlManager
getApplicablePolicies in interface AccessControlManagergetApplicablePolicies in class AbstractAccessControlManagerabsPath - Path to an existing node.
PathNotFoundException
AccessDeniedException
RepositoryExceptionAccessControlManager.getApplicablePolicies(String)
public void setPolicy(String absPath,
AccessControlPolicy policy)
throws PathNotFoundException,
AccessControlException,
AccessDeniedException,
RepositoryException
AbstractAccessControlManagerAccessControlException
setPolicy in interface AccessControlManagersetPolicy in class AbstractAccessControlManagerPathNotFoundException
AccessControlException
AccessDeniedException
RepositoryExceptionAccessControlManager.setPolicy(String, AccessControlPolicy)
public void removePolicy(String absPath,
AccessControlPolicy policy)
throws PathNotFoundException,
AccessControlException,
AccessDeniedException,
RepositoryException
AbstractAccessControlManagerAccessControlException
removePolicy in interface AccessControlManagerremovePolicy in class AbstractAccessControlManagerPathNotFoundException
AccessControlException
AccessDeniedException
RepositoryExceptionAccessControlManager.removePolicy(String, AccessControlPolicy)
public JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal)
throws AccessDeniedException,
AccessControlException,
UnsupportedRepositoryOperationException,
RepositoryException
getApplicablePolicies in interface JackrabbitAccessControlManagergetApplicablePolicies in class AbstractAccessControlManagerAccessDeniedException
AccessControlException
UnsupportedRepositoryOperationException
RepositoryExceptionJackrabbitAccessControlManager.getApplicablePolicies(Principal)
public JackrabbitAccessControlPolicy[] getPolicies(Principal principal)
throws AccessDeniedException,
AccessControlException,
UnsupportedRepositoryOperationException,
RepositoryException
getPolicies in interface JackrabbitAccessControlManagergetPolicies in class AbstractAccessControlManagerAccessDeniedException
AccessControlException
UnsupportedRepositoryOperationException
RepositoryExceptionJackrabbitAccessControlManager.getApplicablePolicies(Principal)
public boolean hasPrivileges(String absPath,
Set<Principal> principals,
Privilege[] privileges)
throws PathNotFoundException,
RepositoryException
hasPrivileges in interface JackrabbitAccessControlManagerPathNotFoundException
RepositoryExceptionJackrabbitAccessControlManager.hasPrivileges(String, Set, Privilege[])
public Privilege[] getPrivileges(String absPath,
Set<Principal> principals)
throws PathNotFoundException,
RepositoryException
getPrivileges in interface JackrabbitAccessControlManagerPathNotFoundException
RepositoryExceptionJackrabbitAccessControlManager.getPrivileges(String, Set)protected void checkInitialized()
AbstractAccessControlManager
checkInitialized in class AbstractAccessControlManagerAbstractAccessControlManager.checkInitialized()
protected void checkValidNodePath(String absPath)
throws PathNotFoundException,
RepositoryException
AbstractAccessControlManagerabsPath is absolute and points to an existing node.
checkValidNodePath in class AbstractAccessControlManagerabsPath - Path to an existing node.
PathNotFoundException - if no node at absPath exists
or the session does not have privilege to retrieve the node.
RepositoryException - If the given absPath is not
absolute or if some other error occurs.AbstractAccessControlManager.checkValidNodePath(String)
protected void checkPermission(String absPath,
int permission)
throws AccessDeniedException,
RepositoryException
AbstractAccessControlManagerabsPath.
checkPermission in class AbstractAccessControlManagerabsPath - Path to an existing node.permission - Permissions to be checked.
AccessDeniedException - if the session does not have the
specified privileges.
PathNotFoundException - if no node exists at absPath
of if the session does not have the permission to READ it.
RepositoryException - If another error occurs.AbstractAccessControlManager.checkPermission(String,int)
protected PrivilegeRegistry getPrivilegeRegistry()
throws RepositoryException
getPrivilegeRegistry in class AbstractAccessControlManagerRepositoryException - If another error occurs.AbstractAccessControlManager.getPrivilegeRegistry()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||