Package se.conciliate.extensions.store
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnumeration of all available privileges that a MTUser can have on a repository.static enumEnumeration of all available privileges that a MTUser can have globally on a server. -
Method Summary
Modifier and TypeMethodDescriptionexpand()Returns aMTUserfor this user.default IconReturns this users first name.Returns this users full name, i.e.Returns a global id for this user if such an id can be found, otherwise an empty optional is returned.Returns this users last name.Returns this users id.booleanhasPrivileges(Collection<MTUserHeader.RepositoryPrivilege> privileges) Checks if the user has a set of privileges in the current repository.booleanhasPrivileges(MTRepositoryHeader repository, Collection<MTUserHeader.RepositoryPrivilege> privileges) Checks if the user has a set of privileges in the specified repository.booleanhasPrivileges(MTRepositoryHeader repository, MTUserHeader.RepositoryPrivilege... privileges) Checks if the user has a set of privileges in the specified repository.booleanhasPrivileges(MTUserHeader.RepositoryPrivilege... privileges) Checks if the user has a set of privileges in the current repository.booleanhasPrivilegesInAnyRepository(MTUserHeader.RepositoryPrivilege... privileges) Returns true if the user has a set of privileges in any available repository.booleanhasServerPrivileges(Collection<MTUserHeader.ServerPrivilege> privileges) Checks if the user has a set of server privileges.booleanhasServerPrivileges(MTUserHeader.ServerPrivilege... privileges) Checks if the user has a set of privileges in the current repository.booleanisAdmin()This returns true if this user has administrative rights.booleanReturns true if this user is enabled, false otherwise.
-
Method Details
-
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
-
getAvatar24
-
hasPrivileges
Checks if the user has a set of privileges in the current repository.- Parameters:
privileges- The privileges to check for.- Returns:
trueif the user has all the privileges,falseotherwise.- Since:
- 3.0
-
hasPrivilegesInAnyRepository
Returns true if the user has a set of privileges in any available repository. -
hasPrivileges
Checks if the user has a set of privileges in the current repository.- Parameters:
privileges- The privileges to check for.- Returns:
trueif the user has all the privileges,falseotherwise.- 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:
trueif the user has all the privileges,falseotherwise.- 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:
trueif the user has all the privileges,falseotherwise.- Since:
- 3.0
-
hasServerPrivileges
Checks if the user has a set of server privileges.- Parameters:
privileges- The privileges to check for.- Returns:
trueif the user has all the privileges,falseotherwise.- Since:
- 3.0
-
hasServerPrivileges
Checks if the user has a set of privileges in the current repository.- Parameters:
privileges- The privileges to check for.- Returns:
trueif the user has all the privileges,falseotherwise.- Since:
- 3.0
-
expand
Returns aMTUserfor this user. Beware that this might require querying the storage layer for more data.- Returns:
- A
MTUserrepresenting this user. - Throws:
MTAccessException- Since:
- 3.0
-