Class AdminUser
java.lang.Object
fr.paris.lutece.portal.business.user.AdminUser
- All Implemented Interfaces:
fr.paris.lutece.api.user.User,fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource,Serializable
- Direct Known Subclasses:
LuteceDefaultAdminUser
public class AdminUser
extends Object
implements Serializable, fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource, fr.paris.lutece.api.user.User
This Interface defines all methods required for an admin user implementation
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructorAdminUser(String stAccessCode, AdminAuthentication authenticationService) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidadd user's rolesbooleancheckRight(String strRightCode) Verify user rights on a given functionalitybooleanReturn the accessibility modeGet the expiration date of the user account.Returns the authentification service that had authentified the userReturns the authentification type that had authentified the userGet the last login date of the userstatic TimestampgetEmail()Returns the email of this user.Returns the first name of this user.Returns the last name of this user.@NotNull LocaleGet the user's LocaleGet the maximum valid date of the password of the usergetRealm()intReturns user's rightsgetRoles()Deprecated.use getRBACRoles( )intintReturn the user's id<X> XgetUserInfo(String strKey) Gets the user info for a given keyintReturns the user levelbooleanhasRights(int level) Check if current user has rights depending on levelstatic voidinit()InitbooleanisAdmin()Check if this user has admin rightsbooleanCheck if this user has a given rolebooleanCheck if current user has rights over userbooleanCheck if the password has been reinitializedbooleanTells whether the current user is active or notbooleanTells whether the current user is anonymizedvoidsetAccessCode(String strAccessCode) voidsetAccessibilityMode(boolean bAccessibilityMode) Set the accessibility modevoidsetAccountMaxValidDate(Timestamp accountMaxValidDate) Set the expiration date of the user account.voidsetAuthenticationService(String strAuthenticationService) Defines the authentification service that had authentified the uservoidsetAuthenticationType(String strAuthenticationType) Defines the authentification type that had authentified the uservoidsetDateLastLogin(Timestamp dateLastLogin) Set the last login date of the uservoidSets the email of the user to the specified string.voidsetFirstName(String strFirstName) Sets the first name of the user to the specified string.voidsetLastName(String strLastName) Sets the last name of the user to the specified string.voidSet the user LocalevoidsetPasswordMaxValidDate(Timestamp passwordMaxValidDate) Set the maximum valid date of the password of the uservoidsetPasswordReset(boolean bIsPasswordReset) Set pwd resetedvoidDefines user's rightsvoidDefines user's rolesvoidsetStatus(int nStatus) voidsetUserId(int nUserId) Sets the user's id<X> XsetUserInfo(String strKey, X info) Sets a user info for the given key.voidsetUserLevel(int nUserLevel) Defines the user levelvoidsetUserWorkgroups(List<String> workgroups) Defines user's workgroupsvoidsetWorkgroupKey(String strWorkgroupKey) voidupdateRight(Right rightToUpdate) Update user right
-
Field Details
-
RESOURCE_TYPE
- See Also:
-
USER_REALM
USER REALM TYPE- See Also:
-
ACTIVE_CODE
public static final int ACTIVE_CODE- See Also:
-
NOT_ACTIVE_CODE
public static final int NOT_ACTIVE_CODE- See Also:
-
EXPIRED_CODE
public static final int EXPIRED_CODE- See Also:
-
ANONYMIZED_CODE
public static final int ANONYMIZED_CODE- See Also:
-
-
Constructor Details
-
AdminUser
public AdminUser()Constructor -
AdminUser
Constructor- Parameters:
stAccessCode- The User NameauthenticationService- The PortalAuthentication object
-
-
Method Details
-
init
public static void init()Init -
getLocale
Get the user's Locale- Returns:
- The user's locale
-
setLocale
Set the user Locale- Parameters:
locale- The locale
-
getUserId
public int getUserId()Return the user's id- Returns:
- The user id
-
setUserId
public void setUserId(int nUserId) Sets the user's id- Parameters:
nUserId- The User id
-
getStatus
public int getStatus()- Returns:
- Returns the status. Only ACTIVE_CODE, NOT_ACTIVE_CODE or ANONYMIZED_CODE are returned. If the status in an other status, then its equivalent is returned
-
getRealStatus
public int getRealStatus()- Returns:
- Returns the real status of the user.
-
setStatus
public void setStatus(int nStatus) - Parameters:
nStatus- The _nStatus to set.
-
isStatusActive
public boolean isStatusActive()Tells whether the current user is active or not- Returns:
- true if active, false otherwise
-
isStatusAnonymized
public boolean isStatusAnonymized()Tells whether the current user is anonymized- Returns:
- true if anonymized, false otherwise
-
getLastName
Returns the last name of this user.- Specified by:
getLastNamein interfacefr.paris.lutece.api.user.User- Returns:
- the user last name
-
setLastName
Sets the last name of the user to the specified string.- Parameters:
strLastName- the new last name
-
getFirstName
Returns the first name of this user.- Specified by:
getFirstNamein interfacefr.paris.lutece.api.user.User- Returns:
- the user first name
-
setFirstName
Sets the first name of the user to the specified string.- Parameters:
strFirstName- the new first name
-
getEmail
Returns the email of this user.- Specified by:
getEmailin interfacefr.paris.lutece.api.user.User- Returns:
- the user email
-
setEmail
Sets the email of the user to the specified string.- Parameters:
strEmail- the new email
-
getAccessCode
- Specified by:
getAccessCodein interfacefr.paris.lutece.api.user.User- Returns:
- Returns the _strAccessCode.
-
setAccessCode
- Parameters:
strAccessCode- The _strAccessCode to set.
-
getPasswordMaxValidDate
Get the maximum valid date of the password of the user- Returns:
- The maximum valid date of the password of the user
-
setPasswordMaxValidDate
Set the maximum valid date of the password of the user- Parameters:
passwordMaxValidDate- The new maximum valid date of the password of the user, or null if it doesn't have any.
-
getAccountMaxValidDate
Get the expiration date of the user account.- Returns:
- The expiration date of the user account, or null if it doesn't have any.
-
setAccountMaxValidDate
Set the expiration date of the user account.- Parameters:
accountMaxValidDate- The new expiration date of the user account.
-
getRoles
Deprecated.use getRBACRoles( )Returns user's roles- Returns:
- Returns user's roles
-
getUserRoles
- Specified by:
getUserRolesin interfacefr.paris.lutece.api.user.User
-
addRoles
add user's roles- Parameters:
roles- The User roles
-
setRoles
Defines user's roles- Parameters:
roles- The User roles
-
getRights
Returns user's rights- Returns:
- Returns user's rights
-
checkRight
Verify user rights on a given functionality- Parameters:
strRightCode- right code which corresponding to the functionality- Returns:
- true if user have this authorisation and false otherwise
-
setRights
Defines user's rights- Parameters:
rights- The User rights
-
updateRight
Update user right- Parameters:
rightToUpdate- to update in _rights for user
-
setAuthenticationService
Defines the authentification service that had authentified the user- Parameters:
strAuthenticationService- The authentification service
-
getAuthenticationService
Returns the authentification service that had authentified the user- Returns:
- the authentification service that had authentified the user
-
setAuthenticationType
Defines the authentification type that had authentified the user- Parameters:
strAuthenticationType- The authentification type
-
getAuthenticationType
Returns the authentification type that had authentified the user- Returns:
- the authentification type that had authentified the user
-
setUserLevel
public void setUserLevel(int nUserLevel) Defines the user level- Parameters:
nUserLevel- the user level
-
getUserLevel
public int getUserLevel()Returns the user level- Returns:
- the user level
-
isParent
Check if current user has rights over user- Parameters:
user- the user to check- Returns:
- true if current user has higher level than user
-
hasRights
public boolean hasRights(int level) Check if current user has rights depending on level- Parameters:
level- a level id- Returns:
- true if current user has higher level than level
-
isAdmin
public boolean isAdmin()Check if this user has admin rights- Returns:
- true if user has admin rights
-
isInRole
Check if this user has a given role- Parameters:
strRole- The role key- Returns:
- true if user has the role
-
isPasswordReset
public boolean isPasswordReset()Check if the password has been reinitialized- Returns:
- true if it has been reinitialized, false otherwise
-
setPasswordReset
public void setPasswordReset(boolean bIsPasswordReset) Set pwd reseted- Parameters:
bIsPasswordReset- true if it has been reinitialized, false otherwise
-
setAccessibilityMode
public void setAccessibilityMode(boolean bAccessibilityMode) Set the accessibility mode- Parameters:
bAccessibilityMode- true if the mode is accessible, false otherwise
-
getAccessibilityMode
public boolean getAccessibilityMode()Return the accessibility mode- Returns:
- true if the mode is accessible, false otherwise
-
getDateLastLogin
Get the last login date of the user- Returns:
- The last login date of the user
-
setDateLastLogin
Set the last login date of the user- Parameters:
dateLastLogin- The last login date of the user
-
getWorkgroupKey
- Returns:
- the _strWorkgroupKey
-
setWorkgroupKey
- Parameters:
strWorkgroupKey- the _strWorkgroupKey to set
-
getWorkgroup
- Specified by:
getWorkgroupin interfacefr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource
-
setUserInfo
Sets a user info for the given key. User infos are intended to be lightweight attributes that do not expose a UI, by opposition theIAttributesystem. The user infos are not persisted. Subclasses can choose another strategy.- Type Parameters:
X- the value's type stored in the user map info- Parameters:
strKey- the keyinfo- the info- Returns:
- the previous value associated with strKey, or null if there was no mapping for strKey. (A null return can also indicate that null was previously associated with strKey)
- Since:
- 6.2.0
-
getUserInfo
Gets the user info for a given key- Type Parameters:
X- the value's type stored in the user map info- Parameters:
strKey- the key- Returns:
- the info
- Since:
- 6.2.0
- See Also:
-
getDefaultDateLastLogin
-
getUserWorkgroups
- Specified by:
getUserWorkgroupsin interfacefr.paris.lutece.api.user.User
-
setUserWorkgroups
Defines user's workgroups- Parameters:
worgroups- The User workgroups
-
getRealm
- Specified by:
getRealmin interfacefr.paris.lutece.api.user.User
-