Class AbstractAccessControlList
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AbstractAccessControlList
-
- All Implemented Interfaces:
AccessControlList,AccessControlPolicy,JackrabbitAccessControlList,JackrabbitAccessControlPolicy
- Direct Known Subclasses:
ImmutableACL
public abstract class AbstractAccessControlList extends Object implements JackrabbitAccessControlList
Abstract base implementation of theJackrabbitAccessControlListinterface.
-
-
Constructor Summary
Constructors Constructor Description AbstractAccessControlList(@Nullable String oakPath, @NotNull NamePathMapper namePathMapper)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddAccessControlEntry(Principal principal, Privilege[] privileges)booleanaddEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow)Same asJackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)using some implementation specific restrictions.booleanaddEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String,Value> restrictions)Adds an access control entry to this policy consisting of the specifiedprincipal, the specifiedprivileges, theisAllowflag and an optional map containing additional restrictions.AccessControlEntry[]getAccessControlEntries()abstract @NotNull List<? extends JackrabbitAccessControlEntry>getEntries()@NotNull NamePathMappergetNamePathMapper()@Nullable StringgetOakPath()@Nullable StringgetPath()Returns the path of the node this policy has been created for.@NotNull String[]getRestrictionNames()Returns the names of the supported restrictions or an empty array if no restrictions are respected.abstract @NotNull RestrictionProvidergetRestrictionProvider()intgetRestrictionType(@NotNull String restrictionName)Return the expectedproperty typeof the restriction with the specifiedrestrictionName.booleanisEmpty()Returnstrueif this policy does not yet define any entries.booleanisMultiValueRestriction(@NotNull String restrictionName)Returnstrueif the restriction is multivalued;falseotherwise.intsize()Returns the number of entries or 0 if the policyis empty.-
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, orderBefore
-
-
-
-
Constructor Detail
-
AbstractAccessControlList
public AbstractAccessControlList(@Nullable @Nullable String oakPath, @NotNull @NotNull NamePathMapper namePathMapper)
-
-
Method Detail
-
getOakPath
@Nullable public @Nullable String getOakPath()
-
getNamePathMapper
@NotNull public @NotNull NamePathMapper getNamePathMapper()
-
getEntries
@NotNull public abstract @NotNull List<? extends JackrabbitAccessControlEntry> getEntries()
-
getRestrictionProvider
@NotNull public abstract @NotNull RestrictionProvider getRestrictionProvider()
-
getPath
@Nullable public @Nullable String getPath()
Description copied from interface:JackrabbitAccessControlPolicyReturns the path of the node this policy has been created for.- Specified by:
getPathin interfaceJackrabbitAccessControlPolicy- Returns:
- the path of the node this policy has been created for.
-
getAccessControlEntries
public AccessControlEntry[] getAccessControlEntries()
- Specified by:
getAccessControlEntriesin interfaceAccessControlList
-
addAccessControlEntry
public boolean addAccessControlEntry(Principal principal, Privilege[] privileges) throws RepositoryException
- Specified by:
addAccessControlEntryin interfaceAccessControlList- Throws:
RepositoryException
-
isEmpty
public boolean isEmpty()
Description copied from interface:JackrabbitAccessControlListReturnstrueif this policy does not yet define any entries.- Specified by:
isEmptyin interfaceJackrabbitAccessControlList- Returns:
- If no entries are present.
-
size
public int size()
Description copied from interface:JackrabbitAccessControlListReturns the number of entries or 0 if the policyis empty.- Specified by:
sizein interfaceJackrabbitAccessControlList- Returns:
- The number of entries present or 0 if the policy
is empty.
-
getRestrictionNames
@NotNull public @NotNull String[] getRestrictionNames()
Description copied from interface:JackrabbitAccessControlListReturns the names of the supported restrictions or an empty array if no restrictions are respected.- Specified by:
getRestrictionNamesin interfaceJackrabbitAccessControlList- Returns:
- the names of the supported restrictions or an empty array.
- See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)
-
getRestrictionType
public int getRestrictionType(@NotNull @NotNull String restrictionName)Description copied from interface:JackrabbitAccessControlListReturn the expectedproperty typeof the restriction with the specifiedrestrictionName.- Specified by:
getRestrictionTypein interfaceJackrabbitAccessControlList- Parameters:
restrictionName- Any of the restriction names retrieved fromJackrabbitAccessControlList.getRestrictionNames().- Returns:
- expected
property type.
-
isMultiValueRestriction
public boolean isMultiValueRestriction(@NotNull @NotNull String restrictionName)Description copied from interface:JackrabbitAccessControlListReturnstrueif the restriction is multivalued;falseotherwise. If an given implementation doesn't support multivalued restrictions, this method always returnsfalse.- Specified by:
isMultiValueRestrictionin interfaceJackrabbitAccessControlList- Parameters:
restrictionName- Any of the restriction names retrieved fromJackrabbitAccessControlList.getRestrictionNames().- Returns:
trueif the restriction is multivalued;falseif the restriction with the given name is single value or if the implementation doesn't support multivalued restrictions, this method always returnsfalse.- See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map, Map)
-
addEntry
public boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow) throws RepositoryExceptionDescription copied from interface:JackrabbitAccessControlListSame asJackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)using some implementation specific restrictions.- Specified by:
addEntryin interfaceJackrabbitAccessControlList- Parameters:
principal- the principal to add the entry forprivileges- the privileges to addisAllow- iftrueif this is a positive (allow) entry- Returns:
- true if this policy has changed by incorporating the given entry; false otherwise.
- Throws:
AccessControlException- If any of the given parameter is invalid or cannot be handled by the implementation.RepositoryException- If another error occurs.- See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
addEntry
public boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable Map<String,Value> restrictions) throws RepositoryExceptionDescription copied from interface:JackrabbitAccessControlListAdds an access control entry to this policy consisting of the specifiedprincipal, the specifiedprivileges, theisAllowflag and an optional map containing additional restrictions.This method returns
trueif this policy was modified,falseotherwise.An
AccessControlExceptionis thrown if any of the specified parameters is invalid or if some other access control related exception occurs.- Specified by:
addEntryin interfaceJackrabbitAccessControlList- Parameters:
principal- the principal to add the entry forprivileges- the privileges to addisAllow- iftrueif 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 singleValueobject.- Returns:
- true if this policy has changed by incorporating the given entry; false otherwise.
- Throws:
AccessControlException- If any of the given parameter is invalid or cannot be handled by the implementation.RepositoryException- If another error occurs.- See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
-