public interface User extends Principal
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_USER_NAME
The super admin login name.
|
Modifier and Type | Method and Description |
---|---|
String |
getAbbreviation()
Gets the abbreviation of the user.
|
boolean |
getAdminMode()
Returns
true if admin mode is enabled for this user. |
String |
getEMail()
Gets eMail adress of the user.
|
Collection<ExternalGroup> |
getExternalGroups()
Get the users
external groups as a collection . |
Map<String,String> |
getFiletypeBindings()
Get the file type bindings.
|
String |
getLDAPSection()
Gets the LDAPSection attribute of the User object
|
String |
getLoginName()
Get the login name.
|
String |
getName()
Get a combination of login- and realname.
|
String |
getPhoneNumber()
Gets the phone number.
|
String |
getRealname()
The realname of the user.
|
Map<String,String> |
getUserBindings()
Get a map containing user bindings.
|
boolean |
isActive()
Get state (active ->
true or inactive -> false ) of this user. |
boolean |
isAdmin()
Returns
true if the user currently has admin permissions, i.e. is server admin and admin mode is enabled. |
boolean |
isLDAPUser()
Returns
true if this user is a LDAP user. |
boolean |
isProjectAdmin(Project project)
Tests if this user project admin for the provided project.
|
boolean |
isServerAdmin()
Returns
true if this user is the super admin or a member of a server admin group. |
void |
setAbbreviation(String abbreviation)
Sets the abbreviation of the user
|
void |
setActive(boolean active)
Set activation state of user.
|
void |
setAdminMode(boolean value)
Enable admin mode for this user with extended permissions.
|
void |
setEMail(String email)
Sets the email address of the user.
|
void |
setFiletypeBindings(Map<String,String> fileTypeBindings)
Set the file type bindings
|
void |
setLDAPSection(String section)
Sets the lDAPSection attribute of the User object
|
void |
setLDAPUser(boolean isLDAP)
Sets the LDAPUser attribute of the User object
|
void |
setLoginName(String name)
Sets the login name.
|
void |
setLoginPassword(String password)
Sets the password of the user.
|
void |
setPhoneNumber(String phone)
Sets the phone number.
|
void |
setRealname(String name)
Sets the realname of the user.
|
void |
setUserBindings(Map<String,String> userBindings)
Sets and saves the current user bindings.
|
boolean |
verifyPassword(String password)
Verify password.
|
compareTo
static final String ADMIN_USER_NAME
String getLoginName()
void setLoginName(String name)
name
- The new login name.void setLoginPassword(String password)
password
- the new passwordNullPointerException
- if provided password is null.IllegalArgumentException
- if the provided password is empty.boolean verifyPassword(String password)
password
- the password to verify.true
if the password is correct.String getRealname()
void setRealname(String name)
name
- the new realnameString getEMail()
void setEMail(String email)
email
- the new email address.String getPhoneNumber()
void setPhoneNumber(String phone)
phone
- the new phone number.String getAbbreviation()
void setAbbreviation(String abbreviation)
abbreviation
- the new abbreviation.boolean isLDAPUser()
true
if this user is a LDAP user.true
if this user is a LDAP user, else false
.void setLDAPUser(boolean isLDAP)
isLDAP
- the new LDAPUser valueString getLDAPSection()
void setLDAPSection(String section)
section
- the new LDAPSection valueboolean isAdmin()
true
if the user currently has admin permissions, i.e. is server admin
and admin mode
is enabled.true
if this user currently has admin permissions, false
otherwise.isServerAdmin()
,
getAdminMode()
boolean isServerAdmin()
true
if this user is the super admin or a member of a server admin group. Only server admins areallowed to switch to admin mode
.true
true if this user is a server admin, false
otherwisesetAdminMode(boolean)
boolean isProjectAdmin(@Nullable Project project)
server admin
isproject admin of all projects.project
- The project to verify againstproject
or false
if the providedproject
is null
.boolean getAdminMode() throws SecurityException
true
if admin mode is enabled for this user. Admin mode is by default enabled if the user is aserver admin
.SecurityException
setAdminMode(boolean)
,
isServerAdmin()
void setAdminMode(boolean value) throws SecurityException
server admin
, but may be explicity switched off in some environments.value
- Turn admin mode on or off.SecurityException
- Thrown if this user is not a server adminisServerAdmin()
,
getAdminMode()
Map<String,String> getUserBindings()
setUserBindings(java.util.Map<java.lang.String, java.lang.String>)
void setUserBindings(Map<String,String> userBindings)
userBindings
- the new user bindings.SecurityException
- if not called for current user or by admin user.getUserBindings()
Map<String,String> getFiletypeBindings()
setFiletypeBindings(Map<String, String> fileTypeBindings)
void setFiletypeBindings(Map<String,String> fileTypeBindings) throws IOException
fileTypeBindings
- mapping file extensions to program namesIOException
- if the save operation fails on the serverSecurityException
- if not called for current user or by admin user.getFiletypeBindings()
String getName()
boolean isActive()
true
or inactive -> false
) of this user. If the user is deactivated no login is possible.true
if the user is activated.void setActive(boolean active)
@NotNull Collection<ExternalGroup> getExternalGroups()
external groups
as a collection
.Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210