Interface MTUserHeader

All Known Subinterfaces:
MTUser

public interface MTUserHeader
Header interface for users. A user has a unique username and represents a user of the system that can login and work in one or more repositories. For local repositories there is no security model and no actual login procedure is involved. In this case the users are defined per repository and are used only to make it clear who has created or modified models and symbols in the repository. For server repositories the users are used to login to the server and the current users privileges determines the available repositories and what can be done in them.
Since:
3.0
  • Method Details

    • getGlobalID

      Optional<String> getGlobalID()
      Returns a global id for this user if such an id can be found, otherwise an empty optional is returned. An empty optional indicates that the user has not yet logged on to the server AND that we have not yet implemented true global user management. Otherwise, an id should always be possible to return.
      Returns:
    • getUserId

      String getUserId()
      Returns this users id.
      Returns:
      this users id.
      Since:
      3.0
    • getFirstName

      String getFirstName()
      Returns this users first name.
      Returns:
      this users first name.
      Since:
      3.0
    • getLastName

      String getLastName()
      Returns this users last name.
      Returns:
      this users last name.
      Since:
      3.0
    • getFullName

      String getFullName()
      Returns this users full name, i.e. first name + last name.
      Returns:
      The users full name.
      Since:
      3.0
    • isEnabled

      boolean isEnabled()
      Returns true if this user is enabled, false otherwise.
      Returns:
      true if this user is enabled, false otherwise.
    • isAdmin

      boolean isAdmin()
      This returns true if this user has administrative rights.
      Returns:
      true if this user has administrative rights.
      Since:
      3.0
    • getGroups

      Set<String> getGroups()
    • getAvatar24

      default Icon getAvatar24()
    • hasPrivileges

      boolean hasPrivileges(MTUserHeader.RepositoryPrivilege... privileges)
      Checks if the user has a set of privileges in the current repository.
      Parameters:
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • hasPrivilegesInAnyRepository

      boolean hasPrivilegesInAnyRepository(MTUserHeader.RepositoryPrivilege... privileges)
      Returns true if the user has a set of privileges in any available repository.
    • hasPrivileges

      boolean hasPrivileges(Collection<MTUserHeader.RepositoryPrivilege> privileges)
      Checks if the user has a set of privileges in the current repository.
      Parameters:
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • hasPrivileges

      boolean hasPrivileges(MTRepositoryHeader repository, MTUserHeader.RepositoryPrivilege... privileges)
      Checks if the user has a set of privileges in the specified repository.
      Parameters:
      repository - The repository to check in.
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • hasPrivileges

      boolean hasPrivileges(MTRepositoryHeader repository, Collection<MTUserHeader.RepositoryPrivilege> privileges)
      Checks if the user has a set of privileges in the specified repository.
      Parameters:
      repository - The repository to check in.
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • hasServerPrivileges

      boolean hasServerPrivileges(Collection<MTUserHeader.ServerPrivilege> privileges)
      Checks if the user has a set of server privileges.
      Parameters:
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • hasServerPrivileges

      boolean hasServerPrivileges(MTUserHeader.ServerPrivilege... privileges)
      Checks if the user has a set of privileges in the current repository.
      Parameters:
      privileges - The privileges to check for.
      Returns:
      true if the user has all the privileges, false otherwise.
      Since:
      3.0
    • expand

      MTUser expand() throws MTAccessException
      Returns a MTUser for this user. Beware that this might require querying the storage layer for more data.
      Returns:
      A MTUser representing this user.
      Throws:
      MTAccessException
      Since:
      3.0