Class Utils
- java.lang.Object
-
- org.apache.jackrabbit.oak.security.user.Utils
-
public final class Utils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanImpersonateAllUsers(@NotNull Principal principal, @NotNull UserManager userManager)Returntrueif the given principal can impersonate all users.static booleanisAdmin(@NotNull Principal principal, @NotNull UserManager userManager)Returntrueif the given principal is admin.
-
-
-
Method Detail
-
canImpersonateAllUsers
public static boolean canImpersonateAllUsers(@NotNull @NotNull Principal principal, @NotNull @NotNull UserManager userManager)Returntrueif the given principal can impersonate all users. The implementation tests if the given principal refers to an existingUserfor whichUser.isAdmin()returnstrueOR if the user's principal name or any of its membership is configured to impersonate all users.- Parameters:
principal- A non-null principal instance.userManager- The user manager used for the lookup calling {@link UserManager#getAuthorizable(Principal))}- Returns:
trueif the given principal can impersonate all users;falseif that condition is not met or if the evaluation failed.
-
isAdmin
public static boolean isAdmin(@NotNull @NotNull Principal principal, @NotNull @NotNull UserManager userManager)Returntrueif the given principal is admin. The implementation tests if the given principal refers to an existingUserfor whichUser.isAdmin()returnstrue.- Parameters:
principal- A non-null principal instance.userManager- The user manager used for the lookup calling {@link UserManager#getAuthorizable(Principal))}- Returns:
trueif the given principal is admin;falseif that condition is not met or if the evaluation failed.
-
-