public class UnmodifiableAccessControlList extends Object implements JackrabbitAccessControlList
AccessControlList interface that only
allows for reading. The write methods
(addAccessControlEntry
and removeAccessControlEntry)
throw an AccessControlException.| Constructor and Description |
|---|
UnmodifiableAccessControlList(javax.jcr.security.AccessControlList acl)
Construct a new
UnmodifiableAccessControlList |
UnmodifiableAccessControlList(List<? extends javax.jcr.security.AccessControlEntry> accessControlEntries)
Construct a new
UnmodifiableAccessControlList |
UnmodifiableAccessControlList(List<? extends javax.jcr.security.AccessControlEntry> accessControlEntries,
String path,
Map<String,Integer> restrictions)
Construct a new
UnmodifiableAccessControlList |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAccessControlEntry(Principal principal,
javax.jcr.security.Privilege[] privileges) |
boolean |
addEntry(Principal principal,
javax.jcr.security.Privilege[] privileges,
boolean isAllow)
Same as
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map) using
some implementation specific restrictions. |
boolean |
addEntry(Principal principal,
javax.jcr.security.Privilege[] privileges,
boolean isAllow,
Map<String,javax.jcr.Value> restrictions)
Adds an access control entry to this policy consisting of the specified
principal, the specified privileges, the
isAllow flag and an optional map containing additional
restrictions. |
boolean |
addEntry(Principal principal,
javax.jcr.security.Privilege[] privileges,
boolean isAllow,
Map<String,javax.jcr.Value> restrictions,
Map<String,javax.jcr.Value[]> mvRestrictions)
Adds an access control entry to this policy consisting of the specified
principal, the specified privileges, the
isAllow flag and an optional map containing additional
restrictions. |
boolean |
equals(Object obj) |
javax.jcr.security.AccessControlEntry[] |
getAccessControlEntries() |
String |
getPath()
Returns the path of the node this policy has been created for.
|
String[] |
getRestrictionNames()
Returns the names of the supported restrictions or an empty array
if no restrictions are respected.
|
int |
getRestrictionType(String restrictionName)
Return the expected
property type of the
restriction with the specified restrictionName. |
int |
hashCode() |
boolean |
isEmpty()
Returns
true if this policy does not yet define any
entries. |
void |
orderBefore(javax.jcr.security.AccessControlEntry srcEntry,
javax.jcr.security.AccessControlEntry destEntry)
If the
AccessControlList implementation supports
reordering of entries the specified srcEntry is inserted
at the position of the specified destEntry. |
void |
removeAccessControlEntry(javax.jcr.security.AccessControlEntry ace) |
int |
size()
Returns the number of entries or 0 if the policy
is empty. |
public UnmodifiableAccessControlList(javax.jcr.security.AccessControlList acl)
throws javax.jcr.RepositoryException
UnmodifiableAccessControlListacl - The AccessControlList to be wrapped in order to prevent
it's modification.javax.jcr.RepositoryException - The the entries cannot be retrieved from the
specified AccessControlList.public UnmodifiableAccessControlList(List<? extends javax.jcr.security.AccessControlEntry> accessControlEntries)
UnmodifiableAccessControlListaccessControlEntries - A list of access control entries.public javax.jcr.security.AccessControlEntry[] getAccessControlEntries()
throws javax.jcr.RepositoryException
getAccessControlEntries in interface javax.jcr.security.AccessControlListjavax.jcr.RepositoryExceptionAccessControlList.getAccessControlEntries()public boolean addAccessControlEntry(Principal principal, javax.jcr.security.Privilege[] privileges) throws javax.jcr.security.AccessControlException, javax.jcr.RepositoryException
addAccessControlEntry in interface javax.jcr.security.AccessControlListjavax.jcr.security.AccessControlExceptionjavax.jcr.RepositoryExceptionAccessControlList.addAccessControlEntry(Principal, Privilege[])public void removeAccessControlEntry(javax.jcr.security.AccessControlEntry ace)
throws javax.jcr.security.AccessControlException,
javax.jcr.RepositoryException
removeAccessControlEntry in interface javax.jcr.security.AccessControlListjavax.jcr.security.AccessControlExceptionjavax.jcr.RepositoryExceptionAccessControlList.removeAccessControlEntry(AccessControlEntry)public String[] getRestrictionNames()
JackrabbitAccessControlListgetRestrictionNames in interface JackrabbitAccessControlListJackrabbitAccessControlList.getRestrictionNames()public int getRestrictionType(String restrictionName)
JackrabbitAccessControlListproperty type of the
restriction with the specified restrictionName.getRestrictionType in interface JackrabbitAccessControlListrestrictionName - Any of the restriction names retrieved from
JackrabbitAccessControlList.getRestrictionNames().property type.JackrabbitAccessControlList.getRestrictionType(String)public boolean isEmpty()
JackrabbitAccessControlListtrue if this policy does not yet define any
entries.isEmpty in interface JackrabbitAccessControlListJackrabbitAccessControlList.isEmpty()public int size()
JackrabbitAccessControlListis empty.size in interface JackrabbitAccessControlListis empty.JackrabbitAccessControlList.size()public boolean addEntry(Principal principal, javax.jcr.security.Privilege[] privileges, boolean isAllow) throws javax.jcr.security.AccessControlException
JackrabbitAccessControlListJackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map) using
some implementation specific restrictions.addEntry in interface JackrabbitAccessControlListprincipal - the principal to add the entry forprivileges - the privileges to addisAllow - if true if this is a positive (allow) entryjavax.jcr.security.AccessControlException - If any of the given parameter is invalid
or cannot be handled by the implementation.JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean)public boolean addEntry(Principal principal, javax.jcr.security.Privilege[] privileges, boolean isAllow, Map<String,javax.jcr.Value> restrictions) throws javax.jcr.security.AccessControlException
JackrabbitAccessControlListprincipal, the specified privileges, the
isAllow flag and an optional map containing additional
restrictions.
This method returns true if this policy was modified,
false otherwise.
An AccessControlException is thrown if any of the specified
parameters is invalid or if some other access control related exception occurs.
addEntry in interface JackrabbitAccessControlListprincipal - the principal to add the entry forprivileges - the privileges to addisAllow - if true if this is a positive (allow) entryrestrictions - A map of additional restrictions used to narrow the
effect of the entry to be created. The map must map JCR names to a single
Value object.javax.jcr.security.AccessControlException - If any of the given parameter is invalid
or cannot be handled by the implementation.JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)public boolean addEntry(Principal principal, javax.jcr.security.Privilege[] privileges, boolean isAllow, Map<String,javax.jcr.Value> restrictions, Map<String,javax.jcr.Value[]> mvRestrictions) throws javax.jcr.security.AccessControlException, javax.jcr.RepositoryException
JackrabbitAccessControlListprincipal, the specified privileges, the
isAllow flag and an optional map containing additional
restrictions.
This method returns true if this policy was modified,
false otherwise.
An AccessControlException is thrown if any of the specified
parameters is invalid or if some other access control related exception occurs.
addEntry in interface JackrabbitAccessControlListprincipal - the principal to add the entry forprivileges - the privileges to addisAllow - if true if this is a positive (allow) entryrestrictions - A map of additional restrictions used to narrow the
effect of the entry to be created. The map must map JCR names to a single
Value object.javax.jcr.security.AccessControlException - If any of the given parameter is invalid
or cannot be handled by the implementation.javax.jcr.RepositoryException - If another error occurs.AccessControlList.addAccessControlEntry(Principal, Privilege[])public void orderBefore(javax.jcr.security.AccessControlEntry srcEntry,
javax.jcr.security.AccessControlEntry destEntry)
throws javax.jcr.security.AccessControlException
JackrabbitAccessControlListAccessControlList implementation supports
reordering of entries the specified srcEntry is inserted
at the position of the specified destEntry.
If destEntry is null the entry is moved to the
end of the list.
If srcEntry and destEntry are the same no
changes are made.
orderBefore in interface JackrabbitAccessControlListsrcEntry - The access control entry to be moved within the list.destEntry - The entry before which the srcEntry will be moved.javax.jcr.security.AccessControlException - If any of the given entries is invalid or
cannot be handled by the implementation.JackrabbitAccessControlList.orderBefore(AccessControlEntry, AccessControlEntry)public String getPath()
JackrabbitAccessControlPolicygetPath in interface JackrabbitAccessControlPolicyJackrabbitAccessControlPolicy.getPath()public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(Object)Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.