Class AbstractACLTemplate
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authorization.AbstractACLTemplate
-
- All Implemented Interfaces:
AccessControlList
,AccessControlPolicy
,JackrabbitAccessControlList
,JackrabbitAccessControlPolicy
,AccessControlConstants
public abstract class AbstractACLTemplate extends Object implements JackrabbitAccessControlList, AccessControlConstants
AbstractACLTemplate
...
-
-
Field Summary
Fields Modifier and Type Field Description protected String
path
Path of the node this ACL template has been created for.protected ValueFactory
valueFactory
The value factory-
Fields inherited from interface org.apache.jackrabbit.core.security.authorization.AccessControlConstants
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractACLTemplate(String path, ValueFactory valueFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
addAccessControlEntry(Principal principal, Privilege[] privileges)
boolean
addEntry(Principal principal, Privilege[] privileges, boolean isAllow)
boolean
addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions, Map<String,Value[]> mvRestrictions)
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 anAccessControlException
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()
boolean
isEmpty()
void
orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry)
int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.security.AccessControlList
removeAccessControlEntry
-
Methods inherited from interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
addEntry, getRestrictionNames, getRestrictionType, isMultiValueRestriction
-
-
-
-
Field Detail
-
path
protected final String path
Path of the node this ACL template has been created for.
-
valueFactory
protected final ValueFactory valueFactory
The value factory
-
-
Constructor Detail
-
AbstractACLTemplate
protected AbstractACLTemplate(String path, ValueFactory valueFactory)
-
-
Method Detail
-
checkValidEntry
protected abstract void checkValidEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions) throws AccessControlException
Validates the given parameters to create a new ACE and throws anAccessControlException
if any of them is invalid. Otherwise this method returns silently.- Parameters:
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.- Throws:
AccessControlException
- If any of the given parameters is invalid.
-
getEntries
protected abstract List<AccessControlEntry> getEntries()
Return the list of entries, if they are held in an orderable list.- Returns:
- the list of entries.
- See Also:
orderBefore(AccessControlEntry, AccessControlEntry)
-
getPath
public String getPath()
- Specified by:
getPath
in interfaceJackrabbitAccessControlPolicy
- See Also:
JackrabbitAccessControlPolicy.getPath()
-
addEntry
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow) throws AccessControlException, RepositoryException
- Specified by:
addEntry
in interfaceJackrabbitAccessControlList
- Throws:
AccessControlException
RepositoryException
- See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean)
-
addEntry
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions, Map<String,Value[]> mvRestrictions) throws AccessControlException, RepositoryException
- Specified by:
addEntry
in interfaceJackrabbitAccessControlList
- Throws:
AccessControlException
RepositoryException
- See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map, Map)
-
size
public int size()
- Specified by:
size
in interfaceJackrabbitAccessControlList
- See Also:
JackrabbitAccessControlList.size()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceJackrabbitAccessControlList
- See Also:
JackrabbitAccessControlList.isEmpty()
-
orderBefore
public void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry) throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryException
-
getAccessControlEntries
public AccessControlEntry[] getAccessControlEntries() throws RepositoryException
- Specified by:
getAccessControlEntries
in interfaceAccessControlList
- Throws:
RepositoryException
- See Also:
AccessControlList.getAccessControlEntries()
-
addAccessControlEntry
public boolean addAccessControlEntry(Principal principal, Privilege[] privileges) throws AccessControlException, RepositoryException
- Specified by:
addAccessControlEntry
in interfaceAccessControlList
- Throws:
AccessControlException
RepositoryException
- See Also:
AccessControlList.addAccessControlEntry(java.security.Principal , javax.jcr.security.Privilege[])
-
-