Class PrivilegeBitsProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeBitsProvider
-
- All Implemented Interfaces:
PrivilegeConstants
public final class PrivilegeBitsProvider extends Object implements PrivilegeConstants
Reads and writes privilege definitions from and to the repository content without applying any validation.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants
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 Summary
Constructors Constructor Description PrivilegeBitsProvider(org.apache.jackrabbit.oak.api.Root root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Iterable<String>
getAggregatedPrivilegeNames(@NotNull String... privilegeNames)
Return the names of the non-aggregate privileges corresponding to the specifiedprivilegeNames
.@NotNull PrivilegeBits
getBits(@NotNull Iterable<String> privilegeNames)
Returns the bits for the given privilege names@NotNull PrivilegeBits
getBits(@NotNull String... privilegeNames)
Returns the bits for the given privilege names@NotNull PrivilegeBits
getBits(@NotNull Privilege[] privileges, @NotNull org.apache.jackrabbit.oak.namepath.NameMapper nameMapper)
Returns the bits for the given privileges@NotNull Set<String>
getPrivilegeNames(PrivilegeBits privilegeBits)
Resolve the given privilege bits to a set of privilege names.@NotNull org.apache.jackrabbit.oak.api.Tree
getPrivilegesTree()
Returns the root tree for all privilege definitions stored in the content repository.
-
-
-
Method Detail
-
getPrivilegesTree
@NotNull public @NotNull org.apache.jackrabbit.oak.api.Tree getPrivilegesTree()
Returns the root tree for all privilege definitions stored in the content repository.- Returns:
- The privileges root.
-
getBits
@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull String... privilegeNames)
Returns the bits for the given privilege names- Parameters:
privilegeNames
- the names- Returns:
- the privilege bits
-
getBits
@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull Iterable<String> privilegeNames)
Returns the bits for the given privilege names- Parameters:
privilegeNames
- the names- Returns:
- the privilege bits
-
getBits
@NotNull public @NotNull PrivilegeBits getBits(@NotNull @NotNull Privilege[] privileges, @NotNull @NotNull org.apache.jackrabbit.oak.namepath.NameMapper nameMapper)
Returns the bits for the given privileges- Parameters:
privileges
- the privilegesnameMapper
- the name mapper- Returns:
- the privilege bits
-
getPrivilegeNames
@NotNull public @NotNull Set<String> getPrivilegeNames(PrivilegeBits privilegeBits)
Resolve the given privilege bits to a set of privilege names.- Parameters:
privilegeBits
- An instance of privilege bits.- Returns:
- The names of the registered privileges associated with the given bits. Any bits that don't have a corresponding privilege definition will be ignored.
-
getAggregatedPrivilegeNames
@NotNull public @NotNull Iterable<String> getAggregatedPrivilegeNames(@NotNull @NotNull String... privilegeNames)
Return the names of the non-aggregate privileges corresponding to the specifiedprivilegeNames
.- Parameters:
privilegeNames
- The privilege names to be converted.- Returns:
- The names of the non-aggregate privileges that correspond to the
given
privilegeNames
.
-
-