Class ACE
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.ACE
-
- All Implemented Interfaces:
AccessControlEntry,JackrabbitAccessControlEntry
@ProviderType public abstract class ACE extends Object implements JackrabbitAccessControlEntry
Default implementation of theJackrabbitAccessControlEntryinterface. It asserts that the basic contract is fulfilled but does perform any additional validation on the principal, the privileges or the specified restrictions.
-
-
Constructor Summary
Constructors Constructor Description ACE(@Nullable Principal principal, @Nullable PrivilegeBits privilegeBits, boolean isAllow, @Nullable Set<Restriction> restrictions, @NotNull NamePathMapper namePathMapper)Creates a new access control entry.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)@NotNull PrincipalgetPrincipal()@NotNull PrivilegeBitsgetPrivilegeBits()protected abstract @NotNull PrivilegeBitsProvidergetPrivilegeBitsProvider()@NotNull PrivilegeCollectiongetPrivilegeCollection()Returns aPrivilegeCollectionrepresenting the privileges associated with this entry.@Nullable ValuegetRestriction(@NotNull String restrictionName)Return the value of the restriction with the specified name ornullif no such restriction exists.@NotNull String[]getRestrictionNames()Return the names of the restrictions present with this access control entry.@NotNull Set<Restriction>getRestrictions()@Nullable Value[]getRestrictions(@NotNull String restrictionName)Return the values of the restriction with the specified name ornullif no such restriction exists.inthashCode()booleanisAllow()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.security.AccessControlEntry
getPrivileges
-
-
-
-
Constructor Detail
-
ACE
public ACE(@Nullable @Nullable Principal principal, @Nullable @Nullable PrivilegeBits privilegeBits, boolean isAllow, @Nullable @Nullable Set<Restriction> restrictions, @NotNull @NotNull NamePathMapper namePathMapper) throws AccessControlExceptionCreates a new access control entry.- Parameters:
principal- The principal associated with this entry.privilegeBits- The privilege bits defined for this entry.isAllow-trueif the entry is granting privileges.restrictions- A optional set of restrictions.namePathMapper- The name-path mapper- Throws:
AccessControlException- If the givenprincipalorprivilegeBitsarenullor ifprivilegeBitsareempty.
-
-
Method Detail
-
getPrivilegeBits
@NotNull public @NotNull PrivilegeBits getPrivilegeBits()
-
getRestrictions
@NotNull public @NotNull Set<Restriction> getRestrictions()
-
getPrivilegeBitsProvider
@NotNull protected abstract @NotNull PrivilegeBitsProvider getPrivilegeBitsProvider()
-
getPrincipal
@NotNull public @NotNull Principal getPrincipal()
- Specified by:
getPrincipalin interfaceAccessControlEntry
-
isAllow
public boolean isAllow()
- Specified by:
isAllowin interfaceJackrabbitAccessControlEntry- Returns:
- true if this entry adds
Privileges for the principal; false otherwise.
-
getRestrictionNames
@NotNull public @NotNull String[] getRestrictionNames()
Description copied from interface:JackrabbitAccessControlEntryReturn the names of the restrictions present with this access control entry.- Specified by:
getRestrictionNamesin interfaceJackrabbitAccessControlEntry- Returns:
- the names of the restrictions
-
getRestriction
@Nullable public @Nullable Value getRestriction(@NotNull @NotNull String restrictionName) throws RepositoryException
Description copied from interface:JackrabbitAccessControlEntryReturn the value of the restriction with the specified name ornullif no such restriction exists. In case the restriction with the specified name contains multiple value this method will callValueFormatException.- Specified by:
getRestrictionin interfaceJackrabbitAccessControlEntry- Parameters:
restrictionName- The of the restriction as obtained throughJackrabbitAccessControlEntry.getRestrictionNames().- Returns:
- value of the restriction with the specified name or
nullif no such restriction exists. - Throws:
ValueFormatException- If the restriction with the specified name contains multiple values.RepositoryException- if an error occurs.- See Also:
JackrabbitAccessControlEntry.getRestrictions(String)
-
getRestrictions
@Nullable public @Nullable Value[] getRestrictions(@NotNull @NotNull String restrictionName)
Description copied from interface:JackrabbitAccessControlEntryReturn the values of the restriction with the specified name ornullif no such restriction exists. For restrictions that contain just a single value this method is expected to return an array with a single element even if the underlying implementation stored the restriction in single-value JCR property.- Specified by:
getRestrictionsin interfaceJackrabbitAccessControlEntry- Parameters:
restrictionName- The of the restriction as obtained throughJackrabbitAccessControlEntry.getRestrictionNames().- Returns:
- the values of the restriction with the specified name as an array
or
nullif no such restriction exists. The array may contain zero, one or multiple values. - See Also:
JackrabbitAccessControlEntry.getRestriction(String)
-
getPrivilegeCollection
@NotNull public @NotNull PrivilegeCollection getPrivilegeCollection()
Description copied from interface:JackrabbitAccessControlEntryReturns aPrivilegeCollectionrepresenting the privileges associated with this entry.- Specified by:
getPrivilegeCollectionin interfaceJackrabbitAccessControlEntry- Returns:
- A
PrivilegeCollectionwrapping around the privileges defined for this instance ofJackrabbitAccessControlEntry. - See Also:
AccessControlEntry.getPrivileges()
-
-