public abstract class AbstractACLTemplate extends Object implements JackrabbitAccessControlList, AccessControlConstants
AbstractACLTemplate
...Modifier and Type | Field and Description |
---|---|
protected String |
path
Path of the node this ACL template has been created for.
|
protected ValueFactory |
valueFactory
The value factory
|
N_ACCESSCONTROL, N_POLICY, N_REPO_POLICY, NT_REP_ACCESS_CONTROL, NT_REP_ACCESS_CONTROLLABLE, NT_REP_ACE, NT_REP_ACL, NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_PRINCIPAL_ACCESS_CONTROL, NT_REP_REPO_ACCESS_CONTROLLABLE, P_GLOB, P_PRINCIPAL_NAME, P_PRIVILEGES
Modifier | Constructor and Description |
---|---|
protected |
AbstractACLTemplate(String path,
ValueFactory valueFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAccessControlEntry(Principal principal,
Privilege[] privileges) |
boolean |
addEntry(Principal principal,
Privilege[] privileges,
boolean isAllow)
Same as
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map) using
some implementation specific restrictions. |
boolean |
addEntry(Principal principal,
Privilege[] privileges,
boolean isAllow,
Map<String,Value> restrictions,
Map<String,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. |
protected abstract void |
checkValidEntry(Principal principal,
Privilege[] privileges,
boolean isAllow,
Map<String,Value> restrictions)
Validates the given parameters to create a new ACE and throws an
AccessControlException if any of them is invalid. |
AccessControlEntry[] |
getAccessControlEntries() |
protected abstract List<AccessControlEntry> |
getEntries()
Return the list of entries, if they are held in an orderable list.
|
String |
getPath()
Returns the path of the node this policy has been created for.
|
boolean |
isEmpty()
Returns
true if this policy does not yet define any
entries. |
void |
orderBefore(AccessControlEntry srcEntry,
AccessControlEntry destEntry)
If the
AccessControlList implementation supports
reordering of entries the specified srcEntry is inserted
at the position of the specified destEntry . |
int |
size()
Returns the number of entries or 0 if the policy
is empty . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEntry, getRestrictionNames, getRestrictionType
removeAccessControlEntry
protected final String path
protected final ValueFactory valueFactory
protected AbstractACLTemplate(String path, ValueFactory valueFactory)
protected abstract void checkValidEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions) throws AccessControlException
AccessControlException
if any of them is invalid. Otherwise
this method returns silently.principal
- The principal to create the ACE for.privileges
- The privileges to be granted/denied by the ACE.isAllow
- Defines if the privileges are allowed or denied.restrictions
- The additional restrictions.AccessControlException
- If any of the given parameters is invalid.protected abstract List<AccessControlEntry> getEntries()
orderBefore(AccessControlEntry, AccessControlEntry)
public String getPath()
JackrabbitAccessControlPolicy
getPath
in interface JackrabbitAccessControlPolicy
JackrabbitAccessControlPolicy.getPath()
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow) throws AccessControlException, RepositoryException
JackrabbitAccessControlList
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)
using
some implementation specific restrictions.addEntry
in interface JackrabbitAccessControlList
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- if true
if this is a positive (allow) entryAccessControlException
- If any of the given parameter is invalid
or cannot be handled by the implementation.RepositoryException
- If another error occurs.JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean)
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions, Map<String,Value[]> mvRestrictions) throws AccessControlException, RepositoryException
JackrabbitAccessControlList
principal
, 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 JackrabbitAccessControlList
principal
- 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.AccessControlException
- If any of the given parameter is invalid
or cannot be handled by the implementation.RepositoryException
- If another error occurs.JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map, Map)
public int size()
JackrabbitAccessControlList
is empty
.size
in interface JackrabbitAccessControlList
is empty
.JackrabbitAccessControlList.size()
public boolean isEmpty()
JackrabbitAccessControlList
true
if this policy does not yet define any
entries.isEmpty
in interface JackrabbitAccessControlList
JackrabbitAccessControlList.isEmpty()
public void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry) throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryException
JackrabbitAccessControlList
AccessControlList
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 JackrabbitAccessControlList
srcEntry
- The access control entry to be moved within the list.destEntry
- The entry before which the srcEntry
will be moved.AccessControlException
- If any of the given entries is invalid or
cannot be handled by the implementation.UnsupportedRepositoryOperationException
- If ordering is not supported.RepositoryException
- If another error occurs.JackrabbitAccessControlList.orderBefore(javax.jcr.security.AccessControlEntry, javax.jcr.security.AccessControlEntry)
public AccessControlEntry[] getAccessControlEntries() throws RepositoryException
getAccessControlEntries
in interface AccessControlList
RepositoryException
AccessControlList.getAccessControlEntries()
public boolean addAccessControlEntry(Principal principal, Privilege[] privileges) throws AccessControlException, RepositoryException
addAccessControlEntry
in interface AccessControlList
AccessControlException
RepositoryException
AccessControlList.addAccessControlEntry(java.security.Principal , javax.jcr.security.Privilege[])
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.