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 theJackrabbitAccessControlList
interface.
-
-
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 boolean
addAccessControlEntry(Principal principal, Privilege[] privileges)
boolean
addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow)
Same asJackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)
using some implementation specific restrictions.boolean
addEntry(@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
, theisAllow
flag and an optional map containing additional restrictions.AccessControlEntry[]
getAccessControlEntries()
abstract @NotNull List<? extends JackrabbitAccessControlEntry>
getEntries()
@NotNull NamePathMapper
getNamePathMapper()
@Nullable String
getOakPath()
@Nullable String
getPath()
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 RestrictionProvider
getRestrictionProvider()
int
getRestrictionType(@NotNull String restrictionName)
Return the expectedproperty type
of the restriction with the specifiedrestrictionName
.boolean
isEmpty()
Returnstrue
if this policy does not yet define any entries.boolean
isMultiValueRestriction(@NotNull String restrictionName)
Returnstrue
if the restriction is multivalued;false
otherwise.int
size()
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:JackrabbitAccessControlPolicy
Returns the path of the node this policy has been created for.- Specified by:
getPath
in interfaceJackrabbitAccessControlPolicy
- Returns:
- the path of the node this policy has been created for.
-
getAccessControlEntries
public AccessControlEntry[] getAccessControlEntries()
- Specified by:
getAccessControlEntries
in interfaceAccessControlList
-
addAccessControlEntry
public boolean addAccessControlEntry(Principal principal, Privilege[] privileges) throws RepositoryException
- Specified by:
addAccessControlEntry
in interfaceAccessControlList
- Throws:
RepositoryException
-
isEmpty
public boolean isEmpty()
Description copied from interface:JackrabbitAccessControlList
Returnstrue
if this policy does not yet define any entries.- Specified by:
isEmpty
in interfaceJackrabbitAccessControlList
- Returns:
- If no entries are present.
-
size
public int size()
Description copied from interface:JackrabbitAccessControlList
Returns the number of entries or 0 if the policyis empty
.- Specified by:
size
in interfaceJackrabbitAccessControlList
- Returns:
- The number of entries present or 0 if the policy
is empty
.
-
getRestrictionNames
@NotNull public @NotNull String[] getRestrictionNames()
Description copied from interface:JackrabbitAccessControlList
Returns the names of the supported restrictions or an empty array if no restrictions are respected.- Specified by:
getRestrictionNames
in 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:JackrabbitAccessControlList
Return the expectedproperty type
of the restriction with the specifiedrestrictionName
.- Specified by:
getRestrictionType
in 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:JackrabbitAccessControlList
Returnstrue
if the restriction is multivalued;false
otherwise. If an given implementation doesn't support multivalued restrictions, this method always returnsfalse
.- Specified by:
isMultiValueRestriction
in interfaceJackrabbitAccessControlList
- Parameters:
restrictionName
- Any of the restriction names retrieved fromJackrabbitAccessControlList.getRestrictionNames()
.- Returns:
true
if the restriction is multivalued;false
if 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 RepositoryException
Description copied from interface:JackrabbitAccessControlList
Same asJackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)
using some implementation specific restrictions.- Specified by:
addEntry
in interfaceJackrabbitAccessControlList
- Parameters:
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- iftrue
if 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 RepositoryException
Description copied from interface:JackrabbitAccessControlList
Adds an access control entry to this policy consisting of the specifiedprincipal
, the specifiedprivileges
, theisAllow
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.- Specified by:
addEntry
in interfaceJackrabbitAccessControlList
- Parameters:
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- iftrue
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 singleValue
object.- 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[])
-
-