Package de.espirit.firstspirit.access
Interface User
- All Superinterfaces:
Comparable<Principal>
,Principal
FirstSpirit user.
- Since:
- 2.3
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the abbreviation of the user.boolean
Returnstrue
if admin mode is enabled for this user.getEMail()
Gets eMail adress of the user.@NotNull Collection<ExternalGroup>
Get the usersexternal groups
as acollection
.Get the file type bindings.Gets the LDAPSection attribute of the User objectGet the login name.getName()
Get a combination of login- and realname.Gets the phone number.The realname of the user.Get a map containing user bindings.boolean
isActive()
Get state (active ->true
or inactive ->false
) of this user.boolean
isAdmin()
Returnstrue
if the user currently has admin permissions, i.e. isserver admin
andadmin mode
is enabled.boolean
Returnstrue
if this user is an LDAP user.boolean
isProjectAdmin
(@Nullable Project project) Tests if this user project admin for the provided project.
By default aserver admin
isproject admin of all projects.boolean
Returnstrue
if this user is the super admin or a member of a server admin group.void
setAbbreviation
(String abbreviation) Sets the abbreviation of the uservoid
setActive
(boolean active) Set activation state of user.void
setAdminMode
(boolean value) Enable admin mode for this user with extended permissions.void
Sets the email address of the user.void
setFiletypeBindings
(Map<String, String> fileTypeBindings) Set the file type bindingsvoid
setLDAPSection
(String section) Sets the lDAPSection attribute of the User objectvoid
setLDAPUser
(boolean isLDAP) Sets the LDAPUser attribute of the User objectvoid
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.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
ADMIN_USER_NAME
The super admin login name.- Since:
- 2.3
- See Also:
-
-
Method Details
-
getLoginName
String getLoginName()Get the login name.- Returns:
- The login name.
- Since:
- 2.3
-
setLoginName
Sets the login name.- Parameters:
name
- The new login name.- Since:
- 2.3
-
setLoginPassword
Sets the password of the user. Given password must be not null and not empty, otherwise a NullPointerException or IllegalArgumentException would be thrown.- Parameters:
password
- the new password- Throws:
NullPointerException
- if provided password is null.IllegalArgumentException
- if the provided password is empty.- Since:
- 2.3
-
verifyPassword
Verify password.- Parameters:
password
- the password to verify.- Returns:
true
if the password is correct.- Since:
- 2.3
-
getRealname
String getRealname()The realname of the user.- Returns:
- the realname
- Since:
- 2.3
-
setRealname
Sets the realname of the user.- Parameters:
name
- the new realname- Since:
- 2.3
-
getEMail
String getEMail()Gets eMail adress of the user.- Returns:
- The eMail address.
- Since:
- 2.3
-
setEMail
Sets the email address of the user.- Parameters:
email
- the new email address.- Since:
- 2.3
-
getPhoneNumber
String getPhoneNumber()Gets the phone number.- Returns:
- the phone number.
- Since:
- 2.3
-
setPhoneNumber
Sets the phone number.- Parameters:
phone
- the new phone number.- Since:
- 2.3
-
getAbbreviation
String getAbbreviation()Gets the abbreviation of the user.- Returns:
- The abbreviation.
- Since:
- 2.3
-
setAbbreviation
Sets the abbreviation of the user- Parameters:
abbreviation
- the new abbreviation.- Since:
- 2.3
-
isLDAPUser
boolean isLDAPUser()Returnstrue
if this user is an LDAP user.- Returns:
true
if this user is an LDAP user, elsefalse
.- Since:
- 2.3
-
setLDAPUser
void setLDAPUser(boolean isLDAP) Sets the LDAPUser attribute of the User object- Parameters:
isLDAP
- the new LDAPUser value- Since:
- 2.3
-
getLDAPSection
String getLDAPSection()Gets the LDAPSection attribute of the User object- Returns:
- the lDAPSection value
- Since:
- 2.3
-
setLDAPSection
Sets the lDAPSection attribute of the User object- Parameters:
section
- the new LDAPSection value- Since:
- 2.3
-
isAdmin
boolean isAdmin()Returnstrue
if the user currently has admin permissions, i.e. isserver admin
andadmin mode
is enabled.- Returns:
- boolean
true
if this user currently has admin permissions,false
otherwise. - Since:
- 2.3
- See Also:
-
isServerAdmin
boolean isServerAdmin()Returnstrue
if this user is the super admin or a member of a server admin group. Only server admins areallowed toswitch to admin mode
.- Returns:
- boolean
true
true if this user is a server admin,false
otherwise - Since:
- 5.1.24
- See Also:
-
isProjectAdmin
Tests if this user project admin for the provided project.
By default aserver admin
isproject admin of all projects.- Parameters:
project
- The project to verify against- Returns:
- If the user is project admin for the provided
project
orfalse
if the providedproject
isnull
. - Since:
- 3.0.14
-
getAdminMode
Returnstrue
if admin mode is enabled for this user. Admin mode is by default enabled if the user is aserver admin
.- Throws:
SecurityException
- Since:
- 5.1.24
- See Also:
-
setAdminMode
Enable admin mode for this user with extended permissions. Admin mode is enabled by default if the user is aserver admin
, but may be explicity switched off in some environments.- Parameters:
value
- Turn admin mode on or off.- Throws:
SecurityException
- Thrown if this user is not a server admin- Since:
- 5.1.24
- See Also:
-
getUserBindings
Get a map containing user bindings. Predefined keys are:- "url"
default browser - "url_ctrl"
browser used for preview when the ctrl key is pressed - "url_alt"
browser used for preview when the alt key is pressed - "url_ctrl_alt"
browser used for preview when the ctrl and alt key is pressed - "diffproggy"
diff program
- Returns:
- the user bindings
- Since:
- 4.0.17
- See Also:
- "url"
-
setUserBindings
Sets and saves the current user bindings.- Parameters:
userBindings
- the new user bindings.- Throws:
SecurityException
- if not called for current user or by admin user.- Since:
- 4.0.17
- See Also:
-
getFiletypeBindings
Get the file type bindings.- Returns:
- a Map<String, String> mapping file extensions to program start commands
- Since:
- 4.0.17
- See Also:
-
setFiletypeBindings
Set the file type bindings- Parameters:
fileTypeBindings
- mapping file extensions to program names- Throws:
IOException
- if the save operation fails on the serverSecurityException
- if not called for current user or by admin user.- Since:
- 4.0.17
- See Also:
-
getName
String getName()Get a combination of login- and realname. -
isActive
boolean isActive()Get state (active ->true
or inactive ->false
) of this user. If the user is deactivated no login is possible.- Returns:
true
if the user is activated.- Since:
- 4.0.90
-
setActive
void setActive(boolean active) Set activation state of user. If the user is deactivated no login is possible.- Since:
- 4.0.90
-
getExternalGroups
Get the usersexternal groups
as acollection
.- Returns:
- the users external groups as a collection
- Since:
- 5.2.190604
-