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 boolean
canImpersonateAllUsers(@NotNull Principal principal, @NotNull UserManager userManager)
Returntrue
if the given principal can impersonate all users.static boolean
isAdmin(@NotNull Principal principal, @NotNull UserManager userManager)
Returntrue
if the given principal is admin.
-
-
-
Method Detail
-
canImpersonateAllUsers
public static boolean canImpersonateAllUsers(@NotNull @NotNull Principal principal, @NotNull @NotNull UserManager userManager)
Returntrue
if the given principal can impersonate all users. The implementation tests if the given principal refers to an existingUser
for whichUser.isAdmin()
returnstrue
OR 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:
true
if the given principal can impersonate all users;false
if that condition is not met or if the evaluation failed.
-
isAdmin
public static boolean isAdmin(@NotNull @NotNull Principal principal, @NotNull @NotNull UserManager userManager)
Returntrue
if the given principal is admin. The implementation tests if the given principal refers to an existingUser
for whichUser.isAdmin()
returnstrue
.- Parameters:
principal
- A non-null principal instance.userManager
- The user manager used for the lookup calling {@link UserManager#getAuthorizable(Principal))}- Returns:
true
if the given principal is admin;false
if that condition is not met or if the evaluation failed.
-
-