Class UserUtil
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.user.util.UserUtil
-
- All Implemented Interfaces:
UserConstants
public final class UserUtil extends java.lang.Object implements 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_ANONYMOUS_ID, PARAM_AUTHORIZABLE_ACTION_PROVIDER, PARAM_AUTHORIZABLE_NODE_NAME, PARAM_DEFAULT_DEPTH, PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE, PARAM_GROUP_PATH, 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Authorizable>
TcastAuthorizable(@Nullable Authorizable authorizable, java.lang.Class<T> authorizableClass)static @NotNull java.lang.StringgetAdminId(@NotNull ConfigurationParameters parameters)static @NotNull java.lang.StringgetAnonymousId(@NotNull ConfigurationParameters parameters)static @Nullable java.lang.StringgetAuthorizableId(@NotNull Tree authorizableTree)static @NotNull java.lang.StringgetAuthorizableId(@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 java.lang.StringgetAuthorizableRootPath(@NotNull ConfigurationParameters parameters, @Nullable AuthorizableType type)static intgetImportBehavior(@NotNull ConfigurationParameters config)Return the configuredImportBehaviorfor the givenconfig.static @Nullable AuthorizableTypegetType(@NotNull Tree authorizableNode)static @Nullable AuthorizableTypegetType(@Nullable java.lang.String primaryTypeName)static booleanisAdmin(@NotNull ConfigurationParameters parameters, @NotNull java.lang.String userId)static booleanisSystemUser(@Nullable Tree authorizableTree)static booleanisType(@Nullable Tree authorizableTree, @NotNull AuthorizableType type)
-
-
-
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 Tree authorizableTree, @NotNull @NotNull AuthorizableType type)
-
getType
@Nullable public static @Nullable AuthorizableType getType(@NotNull @NotNull Tree authorizableNode)
-
getType
@Nullable public static @Nullable AuthorizableType getType(@Nullable @Nullable java.lang.String primaryTypeName)
-
isSystemUser
public static boolean isSystemUser(@Nullable @Nullable 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 Tree authorizableTree)
-
getAuthorizableId
@NotNull public static @NotNull java.lang.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, java.lang.Class<T> authorizableClass) throws AuthorizableTypeException
- Throws:
AuthorizableTypeException
-
getImportBehavior
public static int getImportBehavior(@NotNull @NotNull ConfigurationParameters config)Return the configuredImportBehaviorfor the givenconfig. The default behavior in caseProtectedItemImporter.PARAM_IMPORT_BEHAVIORis not contained in theconfigobject isImportBehavior.IGNORE- Parameters:
config- The configuration parameters.- Returns:
- The import behavior as defined by
ProtectedItemImporter.PARAM_IMPORT_BEHAVIORorImportBehavior.IGNOREif this config parameter is missing.
-
-