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 theJackrabbitAccessControlEntry
interface. 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 boolean
equals(Object obj)
@NotNull Principal
getPrincipal()
@NotNull PrivilegeBits
getPrivilegeBits()
protected abstract @NotNull PrivilegeBitsProvider
getPrivilegeBitsProvider()
@NotNull PrivilegeCollection
getPrivilegeCollection()
Returns aPrivilegeCollection
representing the privileges associated with this entry.@Nullable Value
getRestriction(@NotNull String restrictionName)
Return the value of the restriction with the specified name ornull
if 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 ornull
if no such restriction exists.int
hashCode()
boolean
isAllow()
-
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 AccessControlException
Creates a new access control entry.- Parameters:
principal
- The principal associated with this entry.privilegeBits
- The privilege bits defined for this entry.isAllow
-true
if the entry is granting privileges.restrictions
- A optional set of restrictions.namePathMapper
- The name-path mapper- Throws:
AccessControlException
- If the givenprincipal
orprivilegeBits
arenull
or ifprivilegeBits
areempty
.
-
-
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:
getPrincipal
in interfaceAccessControlEntry
-
isAllow
public boolean isAllow()
- Specified by:
isAllow
in interfaceJackrabbitAccessControlEntry
- Returns:
- true if this entry adds
Privilege
s for the principal; false otherwise.
-
getRestrictionNames
@NotNull public @NotNull String[] getRestrictionNames()
Description copied from interface:JackrabbitAccessControlEntry
Return the names of the restrictions present with this access control entry.- Specified by:
getRestrictionNames
in interfaceJackrabbitAccessControlEntry
- Returns:
- the names of the restrictions
-
getRestriction
@Nullable public @Nullable Value getRestriction(@NotNull @NotNull String restrictionName) throws RepositoryException
Description copied from interface:JackrabbitAccessControlEntry
Return the value of the restriction with the specified name ornull
if no such restriction exists. In case the restriction with the specified name contains multiple value this method will callValueFormatException
.- Specified by:
getRestriction
in interfaceJackrabbitAccessControlEntry
- Parameters:
restrictionName
- The of the restriction as obtained throughJackrabbitAccessControlEntry.getRestrictionNames()
.- Returns:
- value of the restriction with the specified name or
null
if 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:JackrabbitAccessControlEntry
Return the values of the restriction with the specified name ornull
if 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:
getRestrictions
in 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
null
if 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:JackrabbitAccessControlEntry
Returns aPrivilegeCollection
representing the privileges associated with this entry.- Specified by:
getPrivilegeCollection
in interfaceJackrabbitAccessControlEntry
- Returns:
- A
PrivilegeCollection
wrapping around the privileges defined for this instance ofJackrabbitAccessControlEntry
. - See Also:
AccessControlEntry.getPrivileges()
-
-