Class PrivilegeCollection.Default
- java.lang.Object
-
- org.apache.jackrabbit.api.security.authorization.PrivilegeCollection.Default
-
- All Implemented Interfaces:
PrivilegeCollection
- Enclosing interface:
- PrivilegeCollection
public static class PrivilegeCollection.Default extends java.lang.Object implements PrivilegeCollection
Default implementation of thePrivilegeCollectioninterface. Note that this implementation uses JCR API to resolve privilege aggregation, which is expected to be inefficient. Implementations ofJackrabbitAccessControlManager.getPrivilegeCollection(String)andJackrabbitAccessControlManager.getPrivilegeCollection(String, Set)therefore should provide improved implementations of thePrivilegeCollectioninterface.- Since:
- Oak 1.42.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.api.security.authorization.PrivilegeCollection
PrivilegeCollection.Default
-
-
Constructor Summary
Constructors Constructor Description Default(@NotNull Privilege[] privileges, @NotNull AccessControlManager accessControlManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Privilege[]getPrivileges()Return the underlying privilege array.booleanincludes(@NotNull java.lang.String... privilegeNames)Tests whether the given JCRprivilegeNamesare contained in the privileges for which this instance ofPrivilegeEvaluationhas been created such as e.g.
-
-
-
Constructor Detail
-
Default
public Default(@NotNull @NotNull Privilege[] privileges, @NotNull @NotNull AccessControlManager accessControlManager)
-
-
Method Detail
-
getPrivileges
public Privilege[] getPrivileges()
Description copied from interface:PrivilegeCollectionReturn the underlying privilege array.- Specified by:
getPrivilegesin interfacePrivilegeCollection- Returns:
- the privilege array for which this instance has been created.
-
includes
public boolean includes(@NotNull @NotNull java.lang.String... privilegeNames) throws RepositoryExceptionDescription copied from interface:PrivilegeCollectionTests whether the given JCRprivilegeNamesare contained in the privileges for which this instance ofPrivilegeEvaluationhas been created such as e.g. throughJackrabbitAccessControlManager.getPrivilegeCollection(String)orJackrabbitAccessControlManager.getPrivilegeCollection(String, Set). The inclusion can either be direct or through privilege aggregation.- Specified by:
includesin interfacePrivilegeCollection- Parameters:
privilegeNames- The JCR names of privileges to be tested. They can be passed in expanded form (like e.g.Privilege.JCR_READ) or in qualified form (i.e. 'jcr:read' if 'jcr' was the prefixed defined for the 'http://www.jcp.org/jcr/1.0' namespace.- Returns:
trueif the underlyingprivilegesinclude all specified privilege names either directly or by means of aggregation;falseif one or multiple privileges are not included. Ifjcr:allprivilege is part of this collection or if no privilege names are specified this method will returntrue. If no privileges are grantedfalseis returned.- Throws:
AccessControlException- If any of the given privilege names is invalid i.e. no such privilege exists.RepositoryException- If another error occurs.
-
-