Interface User
- All Superinterfaces:
Authorizable
User is a special
Authorizable
that can be authenticated and
impersonated.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changePassword
(@Nullable String password) Change the password of this user.void
changePassword
(@Nullable String password, @NotNull String oldPassword) Change the password of this user.void
Disable this user thus preventing future login if thereason
is a non-null String.
Note however, that this user will still be accessible byUserManager.getAuthorizable(java.lang.String)
.@NotNull Credentials
Returns the internalCredentials
representation for this user.@Nullable String
@NotNull Impersonation
boolean
isAdmin()
boolean
Returnstrue
if this user is disabled,false
otherwise.boolean
Methods inherited from interface org.apache.jackrabbit.api.security.user.Authorizable
declaredMemberOf, getID, getPath, getPrincipal, getProperty, getPropertyNames, getPropertyNames, hasProperty, isGroup, memberOf, remove, removeProperty, setProperty, setProperty
-
Method Details
-
isAdmin
boolean isAdmin()- Returns:
- true if the current user represents the administrator.
-
isSystemUser
boolean isSystemUser()- Returns:
- true if the current user represents a system user.
-
getCredentials
Returns the internalCredentials
representation for this user. This method is expected to be used for validation during the login process. However, the return value should neither be usable nor used forRepository.login(javax.jcr.Credentials, java.lang.String)
.- Returns:
Credentials
for this user.- Throws:
RepositoryException
- If an error occurs.
-
getImpersonation
- Returns:
Impersonation
for thisUser
.- Throws:
RepositoryException
- If an error occurs.
-
changePassword
Change the password of this user.- Parameters:
password
- The new password.- Throws:
RepositoryException
- If an error occurs.
-
changePassword
void changePassword(@Nullable @Nullable String password, @NotNull @NotNull String oldPassword) throws RepositoryException Change the password of this user.- Parameters:
password
- The new password.oldPassword
- The old password.- Throws:
RepositoryException
- If the old password doesn't match or if an error occurs.
-
disable
Disable this user thus preventing future login if thereason
is a non-null String.
Note however, that this user will still be accessible byUserManager.getAuthorizable(java.lang.String)
.- Parameters:
reason
- String describing the reason for disable this user ornull
if the user account should be enabled again.- Throws:
RepositoryException
- If an error occurs.
-
isDisabled
Returnstrue
if this user is disabled,false
otherwise.- Returns:
true
if this user is disabled,false
otherwise.- Throws:
RepositoryException
- If an error occurs.
-
getDisabledReason
- Returns:
- The reason specified upon disabling this user or
null
if this user is not disabled. - Throws:
RepositoryException
- If an error occurs.
-