|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The AccessManager
can be queried to determines whether permission
is granted to perform a specific action on a specific item.
Field Summary | |
static int |
READ
READ permission constant |
static int |
REMOVE
REMOVE permission constant |
static int |
WRITE
WRITE permission constant |
Method Summary | |
boolean |
canAccess(String workspaceName)
Determines whether the subject of the current context is granted access to the given workspace. |
void |
checkPermission(ItemId id,
int permissions)
Determines whether the specified permissions are granted
on the item with the specified id (i.e. |
void |
close()
Close this access manager. |
void |
init(AMContext context)
Initialize this access manager. |
boolean |
isGranted(ItemId id,
int permissions)
Determines whether the specified permissions are granted
on the item with the specified id (i.e. |
Field Detail |
public static final int READ
public static final int WRITE
public static final int REMOVE
Method Detail |
public void init(AMContext context) throws AccessDeniedException, Exception
AccessDeniedException
will
be thrown if the subject of the given context
is not
granted access to the specified workspace.
context
- access manager context
AccessDeniedException
- if the subject is not granted access
to the specified workspace.
Exception
- if another error occurspublic void close() throws Exception
Exception
- if an error occurspublic void checkPermission(ItemId id, int permissions) throws AccessDeniedException, ItemNotFoundException, RepositoryException
permissions
are granted
on the item with the specified id
(i.e. the target item).
id
- the id of the target itempermissions
- A combination of one or more of the following constants
encoded as a bitmask value:
READ
WRITE
REMOVE
AccessDeniedException
- if permission is denied
ItemNotFoundException
- if the target item does not exist
RepositoryException
- it an error occurspublic boolean isGranted(ItemId id, int permissions) throws ItemNotFoundException, RepositoryException
permissions
are granted
on the item with the specified id
(i.e. the target item).
id
- the id of the target itempermissions
- A combination of one or more of the following constants
encoded as a bitmask value:
READ
WRITE
REMOVE
true
if permission is granted; otherwise false
ItemNotFoundException
- if the target item does not exist
RepositoryException
- if another error occurspublic boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException
workspaceName
- name of workspace
true
if the subject of the current context is
granted access to the given workspace; otherwise false
.
NoSuchWorkspaceException
- if a workspace with the given name
does not exist.
RepositoryException
- if another error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |