Interface AccessControlList
-
- All Superinterfaces:
AccessControlPolicy
- All Known Subinterfaces:
JackrabbitAccessControlList
,PrincipalAccessControlList
- All Known Implementing Classes:
AbstractAccessControlList
,ImmutableACL
public interface AccessControlList extends AccessControlPolicy
TheAccessControlList
is anAccessControlPolicy
representing a list ofaccess control entries
. It is mutable before beingset
to the AccessControlManager and consequently defines methods to read and mutate the list i.e. to get, add or remove individual entries.- Since:
- JCR 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addAccessControlEntry(java.security.Principal principal, Privilege[] privileges)
Adds an access control entry to this policy consisting of the specifiedprincipal
and the specifiedprivileges
.AccessControlEntry[]
getAccessControlEntries()
Returns all access control entries present with this policy.void
removeAccessControlEntry(AccessControlEntry ace)
Removes the specifiedAccessControlEntry
from this policy.
-
-
-
Method Detail
-
getAccessControlEntries
AccessControlEntry[] getAccessControlEntries() throws RepositoryException
Returns all access control entries present with this policy.This method is only guaranteed to return an
AccessControlEntry
if thatAccessControlEntry
has been assigned through this API.- Returns:
- all access control entries present with this policy.
- Throws:
RepositoryException
- if an error occurs.
-
addAccessControlEntry
boolean addAccessControlEntry(java.security.Principal principal, Privilege[] privileges) throws AccessControlException, RepositoryException
Adds an access control entry to this policy consisting of the specifiedprincipal
and the specifiedprivileges
.This method returns
true
if this policy was modified,false
otherwise.How the entries are grouped within the list is an implementation detail. An implementation may e.g. combine the specified privileges with those added by a previous call to
addAccessControlEntry
for the samePrincipal
. However, a call toaddAccessControlEntry
for a givenPrincipal
can never remove aPrivilege
added by a previous call.The modification does not take effect until this policy has been set to a node by calling
AccessControlManager.setPolicy(String, AccessControlPolicy)
andsave
is performed.- Parameters:
principal
- aPrincipal
.privileges
- an array ofPrivilege
s.- Returns:
true
if this policy was modify;false
otherwise.- Throws:
AccessControlException
- if the specified principal or any of the privileges does not exist or if some other access control related exception occurs.RepositoryException
- if another error occurs.
-
removeAccessControlEntry
void removeAccessControlEntry(AccessControlEntry ace) throws AccessControlException, RepositoryException
Removes the specifiedAccessControlEntry
from this policy.Only exactly those entries obtained through
getAccessControlEntries
can be removed. This method does not take effect until this policy has been re-set to a node by callingAccessControlManager.setPolicy(String, AccessControlPolicy)
andsave
is performed.- Parameters:
ace
- the access control entry to be removed.- Throws:
AccessControlException
- if the specified entry is not present on the specified node.RepositoryException
- if another error occurs.
-
-