Class PrivilegeUtil
java.lang.Object
org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeUtil
- All Implemented Interfaces:
PrivilegeConstants
Privilege management related utility methods.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringgetOakName(@Nullable String jcrName, @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper) Convert the given JCR privilege name to an Oak name.getOakNames(@Nullable String[] jcrNames, @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper) Convert the given JCR privilege names to Oak names.static @NotNull org.apache.jackrabbit.oak.api.TreegetPrivilegesTree(@NotNull org.apache.jackrabbit.oak.api.Root root) Returns the root tree for all privilege definitions stored in the content repository.static @NotNull PrivilegeDefinitionreadDefinition(@NotNull org.apache.jackrabbit.oak.api.Tree definitionTree) Reads the privilege definition stored in the specified definition tree.
-
Method Details
-
getPrivilegesTree
@NotNull public static @NotNull org.apache.jackrabbit.oak.api.Tree getPrivilegesTree(@NotNull @NotNull org.apache.jackrabbit.oak.api.Root root) Returns the root tree for all privilege definitions stored in the content repository.- Returns:
- The privileges root.
-
readDefinition
@NotNull public static @NotNull PrivilegeDefinition readDefinition(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree definitionTree) Reads the privilege definition stored in the specified definition tree. Note, that this utility does not check the existence nor the node type of the specified tree.- Parameters:
definitionTree- An existing tree storing a privilege definition.- Returns:
- A new instance of
PrivilegeDefinition.
-
getOakNames
@NotNull public static @NotNull Set<String> getOakNames(@Nullable @Nullable String[] jcrNames, @NotNull @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper) throws AccessControlException Convert the given JCR privilege names to Oak names.- Parameters:
jcrNames- The JCR names of privilegesnamePathMapper- TheNamePathMapperto use for the conversion.- Returns:
- A set of Oak names
- Throws:
AccessControlException- If the given JCR names cannot be converted.
-
getOakName
@NotNull public static @NotNull String getOakName(@Nullable @Nullable String jcrName, @NotNull @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper) throws AccessControlException Convert the given JCR privilege name to an Oak name.- Parameters:
jcrName- The JCR name of a privilege.namePathMapper- TheNamePathMapperto use for the conversion.- Returns:
- the Oak name of the given privilege.
- Throws:
AccessControlException- If the specified name is null or cannot be resolved to an Oak name.
-