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 java.lang.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 java.security.Principal principal, @Nullable PrivilegeBits privilegeBits, boolean isAllow, @Nullable java.util.Set<Restriction> restrictions, @NotNull NamePathMapper namePathMapper)Creates a new access control entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)@NotNull java.security.PrincipalgetPrincipal()Returns the principal associated with this access control entry.@NotNull PrivilegeBitsgetPrivilegeBits()@NotNull PrivilegeCollectiongetPrivilegeCollection()Returns aPrivilegeCollectionrepresenting the privileges associated with this entry.@Nullable ValuegetRestriction(@NotNull java.lang.String restrictionName)Return the value of the restriction with the specified name ornullif no such restriction exists.@NotNull java.lang.String[]getRestrictionNames()Return the names of the restrictions present with this access control entry.@NotNull java.util.Set<Restriction>getRestrictions()@Nullable Value[]getRestrictions(@NotNull java.lang.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
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.security.AccessControlEntry
getPrivileges
-
-
-
-
Constructor Detail
-
ACE
public ACE(@Nullable @Nullable java.security.Principal principal, @Nullable @Nullable PrivilegeBits privilegeBits, boolean isAllow, @Nullable @Nullable java.util.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 java.util.Set<Restriction> getRestrictions()
-
getPrincipal
@NotNull public @NotNull java.security.Principal getPrincipal()
Description copied from interface:AccessControlEntryReturns the principal associated with this access control entry.- Specified by:
getPrincipalin interfaceAccessControlEntry- Returns:
- a
Principal.
-
isAllow
public boolean isAllow()
- Specified by:
isAllowin interfaceJackrabbitAccessControlEntry- Returns:
- true if this entry adds
Privileges for the principal; false otherwise.
-
getRestrictionNames
@NotNull public @NotNull java.lang.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 java.lang.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 java.lang.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()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-