fr.paris.lutece.portal.business.user
Class AdminUser

java.lang.Object
  extended by fr.paris.lutece.portal.business.user.AdminUser
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LuteceDefaultAdminUser

public class AdminUser
extends java.lang.Object
implements java.io.Serializable

This Interface defines all methods required for an admin user implementation

See Also:
Serialized Form

Field Summary
static java.lang.String RESOURCE_TYPE
           
 
Constructor Summary
AdminUser()
          Constructor
AdminUser(java.lang.String stAccessCode, AdminAuthentication authenticationService)
          Constructor
 
Method Summary
 void addRoles(java.util.Map<java.lang.String,AdminRole> roles)
          add user's roles
 boolean checkRight(java.lang.String strRightCode)
          Verify user rights on a given functionality
 java.lang.String getAccessCode()
           
 boolean getAccessibilityMode()
          Return the accessibility mode
 java.lang.String getAuthenticationService()
          Returns the authentification service that had authentified the user
 java.lang.String getAuthenticationType()
          Returns the authentification type that had authentified the user
 java.lang.String getEmail()
          Returns the email of this user.
 java.lang.String getFirstName()
          Returns the first name of this user.
 java.lang.String getLastName()
          Returns the last name of this user.
 java.util.Locale getLocale()
          Get the user's Locale
 java.util.Map<java.lang.String,Right> getRights()
          Returns user's rights
 java.util.Map<java.lang.String,AdminRole> getRoles()
          Returns user's roles
 int getStatus()
           
 int getUserId()
          Return the user's id
 int getUserLevel()
          Returns the user level
 boolean hasRights(int level)
          Check if current user has rights depending on level
static void init()
          Init
 boolean isAdmin()
          Check if this user has admin rights
 boolean isInRole(java.lang.String strRole)
          Check if this user has a given role
 boolean isParent(AdminUser user)
          Check if current user has rights over user
 boolean isPasswordReset()
          Check if the password has been reinitialized
 boolean isStatusActive()
          Tells whether the current user is active or not
 void setAccessCode(java.lang.String strAccessCode)
           
 void setAccessibilityMode(boolean bAccessibilityMode)
          Set the accessibility mode
 void setAuthenticationService(java.lang.String strAuthenticationService)
          Defines the authentification service that had authentified the user
 void setAuthenticationType(java.lang.String strAuthenticationType)
          Defines the authentification type that had authentified the user
 void setEmail(java.lang.String strEmail)
          Sets the email of the user to the specified string.
 void setFirstName(java.lang.String strFirstName)
          Sets the first name of the user to the specified string.
 void setLastName(java.lang.String strLastName)
          Sets the last name of the user to the specified string.
 void setLocale(java.util.Locale locale)
          Set the user Locale
 void setPasswordReset(boolean bIsPasswordReset)
          Set pwd reseted
 void setRights(java.util.Map<java.lang.String,Right> rights)
          Defines user's rights
 void setRoles(java.util.Map<java.lang.String,AdminRole> roles)
          Defines user's roles
 void setStatus(int nStatus)
           
 void setUserId(int nUserId)
          Sets the user's id
 void setUserLevel(int nUserLevel)
          Defines the user level
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_TYPE

public static java.lang.String RESOURCE_TYPE
Constructor Detail

AdminUser

public AdminUser()
Constructor


AdminUser

public AdminUser(java.lang.String stAccessCode,
                 AdminAuthentication authenticationService)
Constructor

Parameters:
stAccessCode - The User Name
authenticationService - The PortalAuthentication object
Method Detail

init

public static void init()
Init


getLocale

public java.util.Locale getLocale()
Get the user's Locale

Returns:
The user's locale

setLocale

public void setLocale(java.util.Locale locale)
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 _nStatus.

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

getLastName

public java.lang.String getLastName()
Returns the last name of this user.

Returns:
the user last name

setLastName

public void setLastName(java.lang.String strLastName)
Sets the last name of the user to the specified string.

Parameters:
strLastName - the new last name

getFirstName

public java.lang.String getFirstName()
Returns the first name of this user.

Returns:
the user first name

setFirstName

public void setFirstName(java.lang.String strFirstName)
Sets the first name of the user to the specified string.

Parameters:
strFirstName - the new first name

getEmail

public java.lang.String getEmail()
Returns the email of this user.

Returns:
the user email

setEmail

public void setEmail(java.lang.String strEmail)
Sets the email of the user to the specified string.

Parameters:
strEmail - the new email

getAccessCode

public java.lang.String getAccessCode()
Returns:
Returns the _strAccessCode.

setAccessCode

public void setAccessCode(java.lang.String strAccessCode)
Parameters:
strAccessCode - The _strAccessCode to set.

getRoles

public java.util.Map<java.lang.String,AdminRole> getRoles()
Returns user's roles

Returns:
Returns user's roles

addRoles

public void addRoles(java.util.Map<java.lang.String,AdminRole> roles)
add user's roles

Parameters:
roles - The User roles

setRoles

public void setRoles(java.util.Map<java.lang.String,AdminRole> roles)
Defines user's roles

Parameters:
roles - The User roles

getRights

public java.util.Map<java.lang.String,Right> getRights()
Returns user's rights

Returns:
Returns user's rights

checkRight

public boolean checkRight(java.lang.String strRightCode)
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

public void setRights(java.util.Map<java.lang.String,Right> rights)
Defines user's rights

Parameters:
rights - The User rights

setAuthenticationService

public void setAuthenticationService(java.lang.String strAuthenticationService)
Defines the authentification service that had authentified the user

Parameters:
strAuthenticationService - The authentification service

getAuthenticationService

public java.lang.String getAuthenticationService()
Returns the authentification service that had authentified the user

Returns:
the authentification service that had authentified the user

setAuthenticationType

public void setAuthenticationType(java.lang.String strAuthenticationType)
Defines the authentification type that had authentified the user

Parameters:
strAuthenticationType - The authentification type

getAuthenticationType

public java.lang.String 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

public boolean isParent(AdminUser user)
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

public boolean isInRole(java.lang.String strRole)
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


Copyright © 2011 Mairie de Paris. All Rights Reserved.