Class PrivilegeUtil
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeUtil
-
- All Implemented Interfaces:
PrivilegeConstants
public final class PrivilegeUtil extends java.lang.Object implements 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull java.lang.String
getOakName(@Nullable java.lang.String jcrName, @NotNull NamePathMapper namePathMapper)
Convert the given JCR privilege name to an Oak name.static @NotNull java.util.Set<java.lang.String>
getOakNames(@Nullable java.lang.String[] jcrNames, @NotNull NamePathMapper namePathMapper)
Convert the given JCR privilege names to Oak names.static @NotNull Tree
getPrivilegesTree(@NotNull Root root)
Returns the root tree for all privilege definitions stored in the content repository.static @NotNull PrivilegeDefinition
readDefinition(@NotNull Tree definitionTree)
Reads the privilege definition stored in the specified definition tree.
-
-
-
Method Detail
-
getPrivilegesTree
@NotNull public static @NotNull Tree getPrivilegesTree(@NotNull @NotNull 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 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 java.util.Set<java.lang.String> getOakNames(@Nullable @Nullable java.lang.String[] jcrNames, @NotNull @NotNull NamePathMapper namePathMapper) throws AccessControlException
Convert the given JCR privilege names to Oak names.- Parameters:
jcrNames
- The JCR names of privilegesnamePathMapper
- TheNamePathMapper
to 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 java.lang.String getOakName(@Nullable @Nullable java.lang.String jcrName, @NotNull @NotNull NamePathMapper namePathMapper) throws AccessControlException
Convert the given JCR privilege name to an Oak name.- Parameters:
jcrName
- The JCR name of a privilege.namePathMapper
- TheNamePathMapper
to 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.
-
-