java.lang.Object
org.apache.jackrabbit.oak.spi.security.user.util.UserUtil
All Implemented Interfaces:
UserConstants

public final class UserUtil extends Object implements UserConstants
Utility methods for user management.
  • Method Details

    • isAdmin

      public static boolean isAdmin(@NotNull @NotNull ConfigurationParameters parameters, @NotNull @NotNull String userId)
    • getAdminId

      @NotNull public static @NotNull String getAdminId(@NotNull @NotNull ConfigurationParameters parameters)
    • getAnonymousId

      @NotNull public static @NotNull String getAnonymousId(@NotNull @NotNull ConfigurationParameters parameters)
    • isType

      public static boolean isType(@Nullable @Nullable org.apache.jackrabbit.oak.api.Tree authorizableTree, @NotNull @NotNull AuthorizableType type)
    • getType

      @Nullable public static @Nullable AuthorizableType getType(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree authorizableNode)
    • getType

      @Nullable public static @Nullable AuthorizableType getType(@Nullable @Nullable String primaryTypeName)
    • isSystemUser

      public static boolean isSystemUser(@Nullable @Nullable org.apache.jackrabbit.oak.api.Tree authorizableTree)
    • getAuthorizableRootPath

      @Nullable public static @Nullable String getAuthorizableRootPath(@NotNull @NotNull ConfigurationParameters parameters, @Nullable @Nullable AuthorizableType type)
    • getAuthorizableId

      @Nullable public static @Nullable String getAuthorizableId(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree authorizableTree)
    • getAuthorizableId

      @NotNull public static @NotNull String getAuthorizableId(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree authorizableTree, @NotNull @NotNull AuthorizableType type)
      Retrieve the id from the given authorizableTree, which must have been verified for being a valid authorizable of the specified type upfront.
      Parameters:
      authorizableTree - The authorizable tree which must be of the given type/
      type - The type of the authorizable tree.
      Returns:
      The id retrieved from the specified AuthorizableTree.
    • castAuthorizable

      @Nullable public static <T extends org.apache.jackrabbit.api.security.user.Authorizable> T castAuthorizable(@Nullable @Nullable org.apache.jackrabbit.api.security.user.Authorizable authorizable, Class<T> authorizableClass) throws org.apache.jackrabbit.api.security.user.AuthorizableTypeException
      Throws:
      org.apache.jackrabbit.api.security.user.AuthorizableTypeException
    • getImportBehavior

      public static int getImportBehavior(@NotNull @NotNull ConfigurationParameters config)
      Return the configured ImportBehavior for the given config. The default behavior in case ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR is not contained in the config object is ImportBehavior.IGNORE
      Parameters:
      config - The configuration parameters.
      Returns:
      The import behavior as defined by ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR or ImportBehavior.IGNORE if this config parameter is missing.