Interface AccessManager
-
- All Known Implementing Classes:
WorkspaceManager
public interface AccessManager
TheAccessManager
can be queried to determines whether permission is granted to perform a specific action on a specific item.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADD_NODE_ACTION
static String[]
READ
static String
READ_ACTION
predefined action constantsstatic String[]
REMOVE
static String
REMOVE_ACTION
static String
SET_PROPERTY_ACTION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canAccess(String workspaceName)
Determines whether the subject of the current context is granted access to the given workspace.boolean
canRead(ItemState itemState)
Returns true if the existing item with the givenItemId
can be read.boolean
canRemove(ItemState itemState)
Returns true if the existing item state can be removed.boolean
isGranted(ItemState itemState, String[] actions)
Determines whether the specifiedpermissions
are granted on the item with the specified path.boolean
isGranted(NodeState parentState, Path relPath, String[] actions)
Determines whether the specifiedpermissions
are granted on the item with the specified path.
-
-
-
Field Detail
-
READ_ACTION
static final String READ_ACTION
predefined action constants- See Also:
- Constant Field Values
-
REMOVE_ACTION
static final String REMOVE_ACTION
- See Also:
- Constant Field Values
-
ADD_NODE_ACTION
static final String ADD_NODE_ACTION
- See Also:
- Constant Field Values
-
SET_PROPERTY_ACTION
static final String SET_PROPERTY_ACTION
- See Also:
- Constant Field Values
-
READ
static final String[] READ
-
REMOVE
static final String[] REMOVE
-
-
Method Detail
-
isGranted
boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws ItemNotFoundException, RepositoryException
Determines whether the specifiedpermissions
are granted on the item with the specified path.- Parameters:
parentState
- The node state of the next existing ancestor.relPath
- The relative path pointing to the non-existing target item.actions
- An array of actions that need to be checked.- Returns:
true
if the actions are granted; otherwisefalse
- Throws:
ItemNotFoundException
- if the target item does not existRepositoryException
- if another error occurs
-
isGranted
boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException
Determines whether the specifiedpermissions
are granted on the item with the specified path.- Parameters:
itemState
-actions
- An array of actions that need to be checked.- Returns:
true
if the actions are granted; otherwisefalse
- Throws:
ItemNotFoundException
- if the target item does not existRepositoryException
- if another error occurs
-
canRead
boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException
Returns true if the existing item with the givenItemId
can be read.- Parameters:
itemState
-- Returns:
- Throws:
ItemNotFoundException
RepositoryException
-
canRemove
boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException
Returns true if the existing item state can be removed.- Parameters:
itemState
-- Returns:
- Throws:
ItemNotFoundException
RepositoryException
-
canAccess
boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException
Determines whether the subject of the current context is granted access to the given workspace.- Parameters:
workspaceName
- name of workspace- Returns:
true
if the subject of the current context is granted access to the given workspace; otherwisefalse
.- Throws:
NoSuchWorkspaceException
- if a workspace with the given name does not exist.RepositoryException
- if another error occurs
-
-