Class UserUtil

  • All Implemented Interfaces:
    UserConstants

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

      • isAdmin

        public static boolean isAdmin​(@NotNull
                                      @NotNull ConfigurationParameters parameters,
                                      @NotNull
                                      @NotNull java.lang.String userId)
      • getAdminId

        @NotNull
        public static @NotNull java.lang.String getAdminId​(@NotNull
                                                           @NotNull ConfigurationParameters parameters)
      • getAnonymousId

        @NotNull
        public static @NotNull java.lang.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 java.lang.String primaryTypeName)
      • isSystemUser

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

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

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

        @NotNull
        public static @NotNull java.lang.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,
                                                                                                          java.lang.Class<T> authorizableClass)
                                                                                                   throws org.apache.jackrabbit.api.security.user.AuthorizableTypeException
        Throws:
        org.apache.jackrabbit.api.security.user.AuthorizableTypeException