Class UserUtil
java.lang.Object
org.apache.jackrabbit.oak.spi.security.user.util.UserUtil
- All Implemented Interfaces:
UserConstants
Utility methods for user management.
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.user.UserConstants
CREDENTIALS_ATTRIBUTE_NEWPASSWORD, DEFAULT_ADMIN_ID, DEFAULT_ANONYMOUS_ID, DEFAULT_DEPTH, DEFAULT_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE, DEFAULT_GROUP_PATH, DEFAULT_PASSWORD_INITIAL_CHANGE, DEFAULT_PASSWORD_MAX_AGE, DEFAULT_SYSTEM_RELATIVE_PATH, DEFAULT_USER_PATH, GROUP_PROPERTY_NAMES, MIX_REP_IMPERSONATABLE, NT_NAMES, NT_REP_AUTHORIZABLE, NT_REP_AUTHORIZABLE_FOLDER, NT_REP_GROUP, NT_REP_MEMBER_REFERENCES, NT_REP_MEMBER_REFERENCES_LIST, NT_REP_MEMBERS, NT_REP_PASSWORD, NT_REP_SYSTEM_USER, NT_REP_USER, PARAM_ADMIN_ID, PARAM_ALLOW_DISABLE_ANONYMOUS, PARAM_ANONYMOUS_ID, PARAM_AUTHORIZABLE_ACTION_PROVIDER, PARAM_AUTHORIZABLE_NODE_NAME, PARAM_DEFAULT_DEPTH, PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE, PARAM_GROUP_PATH, PARAM_IMPERSONATOR_PRINCIPAL_NAMES, PARAM_OMIT_ADMIN_PW, PARAM_PASSWORD_HASH_ALGORITHM, PARAM_PASSWORD_HASH_ITERATIONS, PARAM_PASSWORD_HISTORY_SIZE, PARAM_PASSWORD_INITIAL_CHANGE, PARAM_PASSWORD_MAX_AGE, PARAM_PASSWORD_SALT_SIZE, PARAM_SUPPORT_AUTOSAVE, PARAM_SYSTEM_RELATIVE_PATH, PARAM_USER_AUTHENTICATION_FACTORY, PARAM_USER_PATH, PASSWORD_HISTORY_DISABLED_SIZE, PWD_PROPERTY_NAMES, REP_AUTHORIZABLE_ID, REP_DISABLED, REP_IMPERSONATORS, REP_MEMBERS, REP_MEMBERS_LIST, REP_PASSWORD, REP_PASSWORD_LAST_MODIFIED, REP_PRINCIPAL_NAME, REP_PWD, REP_PWD_HISTORY, USER_PROPERTY_NAMES
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Authorizable>
TcastAuthorizable
(@Nullable Authorizable authorizable, Class<T> authorizableClass) static @NotNull String
getAdminId
(@NotNull ConfigurationParameters parameters) static @NotNull String
getAnonymousId
(@NotNull ConfigurationParameters parameters) static @Nullable String
getAuthorizableId
(@NotNull Tree authorizableTree) static @NotNull String
getAuthorizableId
(@NotNull Tree authorizableTree, @NotNull AuthorizableType type) Retrieve the id from the givenauthorizableTree
, which must have been verified for being a valid authorizable of the specified type upfront.static @Nullable String
getAuthorizableRootPath
(@NotNull ConfigurationParameters parameters, @Nullable AuthorizableType type) static int
getImportBehavior
(@NotNull ConfigurationParameters config) Return the configuredImportBehavior
for the givenconfig
.static @Nullable AuthorizableType
static @Nullable AuthorizableType
static boolean
isAdmin
(@NotNull ConfigurationParameters parameters, @NotNull String userId) static boolean
isSystemUser
(@Nullable Tree authorizableTree) static boolean
isType
(@Nullable Tree authorizableTree, @NotNull AuthorizableType type)
-
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 Tree authorizableTree, @NotNull @NotNull AuthorizableType type) -
getType
-
getType
@Nullable public static @Nullable AuthorizableType getType(@Nullable @Nullable String primaryTypeName) -
isSystemUser
-
getAuthorizableRootPath
@Nullable public static @Nullable String getAuthorizableRootPath(@NotNull @NotNull ConfigurationParameters parameters, @Nullable @Nullable AuthorizableType type) -
getAuthorizableId
-
getAuthorizableId
@NotNull public static @NotNull String getAuthorizableId(@NotNull @NotNull Tree authorizableTree, @NotNull @NotNull AuthorizableType type) Retrieve the id from the givenauthorizableTree
, 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 giventype
/type
- The type of the authorizable tree.- Returns:
- The id retrieved from the specified
AuthorizableTree
.
-
castAuthorizable
@Nullable public static <T extends Authorizable> T castAuthorizable(@Nullable @Nullable Authorizable authorizable, Class<T> authorizableClass) throws AuthorizableTypeException - Throws:
AuthorizableTypeException
-
getImportBehavior
Return the configuredImportBehavior
for the givenconfig
. The default behavior in caseProtectedItemImporter.PARAM_IMPORT_BEHAVIOR
is not contained in theconfig
object isImportBehavior.IGNORE
- Parameters:
config
- The configuration parameters.- Returns:
- The import behavior as defined by
ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR
orImportBehavior.IGNORE
if this config parameter is missing.
-