public final class PrivilegeBitsProvider extends java.lang.Object implements PrivilegeConstants
representation
of privileges (or their names) and to covert the
internal representation back to privilege names.AGGREGATE_PRIVILEGES, JCR_ADD_CHILD_NODES, JCR_ALL, JCR_LIFECYCLE_MANAGEMENT, JCR_LOCK_MANAGEMENT, JCR_MODIFY_ACCESS_CONTROL, JCR_MODIFY_PROPERTIES, JCR_NAMESPACE_MANAGEMENT, JCR_NODE_TYPE_DEFINITION_MANAGEMENT, JCR_NODE_TYPE_MANAGEMENT, JCR_READ, JCR_READ_ACCESS_CONTROL, JCR_REMOVE_CHILD_NODES, JCR_REMOVE_NODE, JCR_RETENTION_MANAGEMENT, JCR_VERSION_MANAGEMENT, JCR_WORKSPACE_MANAGEMENT, JCR_WRITE, NON_AGGREGATE_PRIVILEGES, NT_REP_PRIVILEGE, NT_REP_PRIVILEGES, PRIVILEGE_NODETYPE_NAMES, PRIVILEGE_PROPERTY_NAMES, PRIVILEGES_PATH, REP_ADD_PROPERTIES, REP_AGGREGATES, REP_ALTER_PROPERTIES, REP_BITS, REP_INDEX_DEFINITION_MANAGEMENT, REP_IS_ABSTRACT, REP_NEXT, REP_PRIVILEGE_MANAGEMENT, REP_PRIVILEGES, REP_READ_NODES, REP_READ_PROPERTIES, REP_REMOVE_PROPERTIES, REP_USER_MANAGEMENT, REP_WRITE
Constructor and Description |
---|
PrivilegeBitsProvider(Root root) |
Modifier and Type | Method and Description |
---|---|
@NotNull java.lang.Iterable<java.lang.String> |
getAggregatedPrivilegeNames(java.lang.String... privilegeNames)
Return the names of the non-aggregate privilege names corresponding to the
specified
privilegeNames . |
@NotNull PrivilegeBits |
getBits(@NotNull java.lang.Iterable<java.lang.String> privilegeNames)
Returns the bits for the given privilege names.
|
@NotNull PrivilegeBits |
getBits(@NotNull java.lang.Iterable<java.lang.String> privilegeNames,
boolean validateNames)
Returns the bits for the given privilege names with the option to verify that all privilege names point to a valid,
registered privilege.
|
@NotNull PrivilegeBits |
getBits(@NotNull Privilege[] privileges,
@NotNull NameMapper nameMapper)
Returns the bits for the given array of privileges.
|
@NotNull PrivilegeBits |
getBits(java.lang.String... privilegeNames)
Returns the bits for the given privilege names.
|
@NotNull java.util.Set<java.lang.String> |
getPrivilegeNames(@Nullable PrivilegeBits privilegeBits)
Resolve the given privilege bits to the corresponding set of privilege names.
|
@NotNull Tree |
getPrivilegesTree()
Returns the root tree for all privilege definitions stored in the content
repository.
|
public PrivilegeBitsProvider(Root root)
@NotNull public @NotNull Tree getPrivilegesTree()
@NotNull public @NotNull PrivilegeBits getBits(@NotNull java.lang.String... privilegeNames)
privilegeNames
- the names@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull java.lang.Iterable<java.lang.String> privilegeNames)
privilegeNames
- the names@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull java.lang.Iterable<java.lang.String> privilegeNames, boolean validateNames) throws AccessControlException
privilegeNames
- An iterable of privilege names.validateNames
- If set to true
this method will throw an AccessControlException if an invalid privilege
name is found (i.e. one that doesn't represent a registered privilege). If set to false
invalid privilege
names will be ignored i.e. making this method equivalent to getBits(String...)
.AccessControlException
- If validateNames
is true
and the any of the specified privilege names is invalid.@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull Privilege[] privileges, @NotNull @NotNull NameMapper nameMapper)
privileges
- An array of privilegesnameMapper
- the name mapper@NotNull public @NotNull java.util.Set<java.lang.String> getPrivilegeNames(@Nullable @Nullable PrivilegeBits privilegeBits)
privilegeBits
- An instance of privilege bits.@NotNull public @NotNull java.lang.Iterable<java.lang.String> getAggregatedPrivilegeNames(@NotNull java.lang.String... privilegeNames)
privilegeNames
.privilegeNames
- The privilege names to be converted.privilegeNames
.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.