Interface NuxeoPrincipal

    • Method Detail

      • getFirstName

        String getFirstName()
        Gets the first name of this principal.
        Returns:
        the first name of this principal
      • getLastName

        String getLastName()
        Gets the last name of this principal.
        Returns:
        the last name of this principal
      • getPassword

        String getPassword()
        Gets the password of this principal.

        Note: Some APIs that return principals from the database intentionally do not fill this field

        Returns:
        the password of this principal
      • getCompany

        String getCompany()
        Gets the company name of this principal.
        Returns:
        the company name
      • getEmail

        String getEmail()
        Get the user email if any. Return null if not email was specified
        Returns:
        the user email or null if none
      • getGroups

        List<StringgetGroups()
        Gets the groups this principal is directly member of.
        Returns:
        the list of the groups
      • getAllGroups

        List<StringgetAllGroups()
        Gets the groups this principal directly or undirectly is member of.
        Returns:
        the list of the groups
      • isMemberOf

        boolean isMemberOf​(String group)
        Recursively test if the user is member of this group.
        Parameters:
        group - The name of the group
      • getRoles

        List<StringgetRoles()
        Gets the roles for this principal.
        Returns:
        the list of the roles
      • getPrincipalId

        String getPrincipalId()
        Returns a generated id that is unique for each principal instance.
        Returns:
        a unique string
      • setPrincipalId

        void setPrincipalId​(String principalId)
        Sets the principalId.
        Parameters:
        principalId - a new principalId for this instance
      • isAdministrator

        boolean isAdministrator()
        Returns true if the principal is an administrator.

        Security checks still apply on the repository for administrator user. If user is a system user, this method will return true.

        Returns:
        true if the principal is an administrator.
      • isAnonymous

        boolean isAnonymous()
        Checks if the principal is anonymous (guest user).
        Returns:
        true if the principal is anonymous.
      • getOriginatingUser

        String getOriginatingUser()
        Gets the base user from which this principal was created, or null if this principal was not created from another user.
        Returns:
        the originating user, or null
      • setOriginatingUser

        void setOriginatingUser​(String originatingUser)
        Sets the originating user.
        Parameters:
        originatingUser - the originating user
      • getActingUser

        String getActingUser()
        Gets the acting user for this principal.

        This is the originating user (usually when this principal is a system user), or if there is none this principal's user.

        Returns:
        the acting user
        Since:
        6.0
      • isTransient

        boolean isTransient()
        Returns true if the principal is a transient principal.
        Since:
        8.1
      • isTransientUsername

        static boolean isTransientUsername​(String username)
        Returns true if the given @{code username} is a transient username.
        Since:
        8.1