Interface User

    • Method Detail

      • 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

        @NotNull
        @NotNull javax.jcr.Credentials getCredentials()
                                               throws javax.jcr.RepositoryException
        Returns the internal Credentials 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 for Repository.login(javax.jcr.Credentials, java.lang.String).
        Returns:
        Credentials for this user.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getImpersonation

        @NotNull
        @NotNull Impersonation getImpersonation()
                                         throws javax.jcr.RepositoryException
        Returns:
        Impersonation for this User.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • changePassword

        void changePassword​(@Nullable
                            @Nullable java.lang.String password)
                     throws javax.jcr.RepositoryException
        Change the password of this user.
        Parameters:
        password - The new password.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • changePassword

        void changePassword​(@Nullable
                            @Nullable java.lang.String password,
                            @NotNull
                            @NotNull java.lang.String oldPassword)
                     throws javax.jcr.RepositoryException
        Change the password of this user.
        Parameters:
        password - The new password.
        oldPassword - The old password.
        Throws:
        javax.jcr.RepositoryException - If the old password doesn't match or if an error occurs.
      • disable

        void disable​(@Nullable
                     @Nullable java.lang.String reason)
              throws javax.jcr.RepositoryException
        Disable this user thus preventing future login if the reason is a non-null String.
        Note however, that this user will still be accessible by UserManager.getAuthorizable(java.lang.String).
        Parameters:
        reason - String describing the reason for disable this user or null if the user account should be enabled again.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • isDisabled

        boolean isDisabled()
                    throws javax.jcr.RepositoryException
        Returns true if this user is disabled, false otherwise.
        Returns:
        true if this user is disabled, false otherwise.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getDisabledReason

        @Nullable
        @Nullable java.lang.String getDisabledReason()
                                              throws javax.jcr.RepositoryException
        Returns the String specified upon disabling this user or null if isDisabled() returns false.
        Returns:
        The reason specified upon disabling this user or null if this user is not disabled.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.