public static class PrivilegeCollection.Default extends java.lang.Object implements PrivilegeCollection
PrivilegeCollection
interface.
Note that this implementation uses JCR API to resolve privilege aggregation, which is expected to be inefficient.
Implementations of JackrabbitAccessControlManager.getPrivilegeCollection(String)
and JackrabbitAccessControlManager.getPrivilegeCollection(String, Set)
therefore should provide improved implementations of the PrivilegeCollection
interface.PrivilegeCollection.Default
Constructor and Description |
---|
Default(@NotNull Privilege[] privileges,
@NotNull AccessControlManager accessControlManager) |
Modifier and Type | Method and Description |
---|---|
Privilege[] |
getPrivileges()
Return the underlying privilege array.
|
boolean |
includes(java.lang.String... privilegeNames)
Tests whether the given JCR
privilegeNames are contained in the privileges for which this instance of
PrivilegeEvaluation has been created such as e.g. |
public Default(@NotNull @NotNull Privilege[] privileges, @NotNull @NotNull AccessControlManager accessControlManager)
public Privilege[] getPrivileges()
PrivilegeCollection
getPrivileges
in interface PrivilegeCollection
public boolean includes(@NotNull java.lang.String... privilegeNames) throws RepositoryException
PrivilegeCollection
privilegeNames
are contained in the privileges for which this instance of
PrivilegeEvaluation
has been created such as e.g. through
JackrabbitAccessControlManager.getPrivilegeCollection(String)
or
JackrabbitAccessControlManager.getPrivilegeCollection(String, Set)
.
The inclusion can either be direct or through privilege aggregation.includes
in interface PrivilegeCollection
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.true
if the underlying privileges
include all specified privilege names either directly
or by means of aggregation; false
if one or multiple privileges are not included. If jcr:all
privilege
is part of this collection or if no privilege names are specified this method will return true
.
If no privileges are granted false
is returned.AccessControlException
- If any of the given privilege names is invalid i.e. no such privilege exists.RepositoryException
- If another error occurs.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.