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

java.lang.Object
  extended by fr.paris.lutece.portal.business.user.AdminUserHome

public final class AdminUserHome
extends java.lang.Object

This class provides instances management methods (create, find, ...) for AdminUser objects


Method Summary
static int checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
          Checks if a given login is already in use
static int checkEmailAlreadyInUse(java.lang.String strEmail)
          Checks if a given email is already in use
static boolean checkRoleAttributed(java.lang.String strRoleKey)
          Checks wether the role is in use or not
static void create(AdminUser user)
           
static void create(LuteceDefaultAdminUser user)
           
static void createRightForUser(int nUserId, java.lang.String strRightId)
           
static void createRoleForUser(int nUserId, java.lang.String strRightId)
           
static java.util.Collection<AdminUser> findByLevel(int nIdLevel)
          Get all users having a given level
static AdminUser findByPrimaryKey(int nUserId)
          Get the user infos from user id
static java.util.Collection<AdminUser> findByRole(java.lang.String strRoleKey)
          Get all users having a given role
static LuteceDefaultAdminUser findLuteceDefaultAdminUserByPrimaryKey(int nUserId)
          Get the user infos from user id
static AdminUser findUserByLogin(java.lang.String strUserLogin)
          Get the user infos from the access code.
static java.util.Collection<AdminUser> findUserList()
           
static java.util.Map<java.lang.String,Right> getRightsListForUser(int nUserId)
          Get the right list associated to a given user id
static java.util.Map<java.lang.String,AdminRole> getRolesListForUser(int nUserId)
          Get the role list associated to a given user id
static void remove(int nUserId)
           
static void removeAllDelegatedRightsForUser(AdminUser user)
           
static void removeAllOwnRightsForUser(AdminUser user)
           
static void removeAllRightsForUser(int nUserId)
           
static void removeAllRolesForUser(int nUserId)
           
static void update(AdminUser user)
           
static void update(LuteceDefaultAdminUser user)
           
static void updateUsersRole(java.lang.String strOldRoleKey, AdminRole role)
          Update role key if role key name has change
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findUserByLogin

public static AdminUser findUserByLogin(java.lang.String strUserLogin)
Get the user infos from the access code.

Parameters:
strUserLogin - the login
Returns:
user info

findByPrimaryKey

public static AdminUser findByPrimaryKey(int nUserId)
Get the user infos from user id

Parameters:
nUserId - the user identifier
Returns:
The user

findUserList

public static java.util.Collection<AdminUser> findUserList()
Returns:
the user list

create

public static void create(AdminUser user)
Parameters:
user - The AdminUser

update

public static void update(AdminUser user)
Parameters:
user - The AdminUser

remove

public static void remove(int nUserId)
Parameters:
nUserId - the user identifier

getRightsListForUser

public static java.util.Map<java.lang.String,Right> getRightsListForUser(int nUserId)
Get the right list associated to a given user id

Parameters:
nUserId - the id of the user to retrieve rights
Returns:
the right list

createRightForUser

public static void createRightForUser(int nUserId,
                                      java.lang.String strRightId)
Parameters:
nUserId - The user identifier
strRightId - The right identifier

removeAllRightsForUser

public static void removeAllRightsForUser(int nUserId)
Parameters:
nUserId - The user identifier

removeAllDelegatedRightsForUser

public static void removeAllDelegatedRightsForUser(AdminUser user)
Parameters:
user - The Admin User object

removeAllOwnRightsForUser

public static void removeAllOwnRightsForUser(AdminUser user)
Parameters:
user - The Admin User object

getRolesListForUser

public static java.util.Map<java.lang.String,AdminRole> getRolesListForUser(int nUserId)
Get the role list associated to a given user id

Parameters:
nUserId - the id of the user to retrieve rights
Returns:
the role list

createRoleForUser

public static void createRoleForUser(int nUserId,
                                     java.lang.String strRightId)
Parameters:
nUserId - the id of the user
strRightId - the right identifier

removeAllRolesForUser

public static void removeAllRolesForUser(int nUserId)
Parameters:
nUserId - the user identifier

checkRoleAttributed

public static boolean checkRoleAttributed(java.lang.String strRoleKey)
Checks wether the role is in use or not

Parameters:
strRoleKey - the role key to check
Returns:
true if the role is attributed, false otherwise

checkAccessCodeAlreadyInUse

public static int checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
Checks if a given login is already in use

Parameters:
strAccessCode - The login
Returns:
user ID if the access code is already used by another user, -1 otherwise

checkEmailAlreadyInUse

public static int checkEmailAlreadyInUse(java.lang.String strEmail)
Checks if a given email is already in use

Parameters:
strEmail - The email
Returns:
user ID if the email is already used by another user, -1 otherwise

create

public static void create(LuteceDefaultAdminUser user)
Parameters:
user - the LuteceDefaultAdminUSer

update

public static void update(LuteceDefaultAdminUser user)
Parameters:
user - the LuteceDefaultAdminUSer

findLuteceDefaultAdminUserByPrimaryKey

public static LuteceDefaultAdminUser findLuteceDefaultAdminUserByPrimaryKey(int nUserId)
Get the user infos from user id

Parameters:
nUserId - the user identifier
Returns:
the delfault admin user

findByRole

public static java.util.Collection<AdminUser> findByRole(java.lang.String strRoleKey)
Get all users having a given role

Parameters:
strRoleKey - The role key
Returns:
A collection of AdminUser

findByLevel

public static java.util.Collection<AdminUser> findByLevel(int nIdLevel)
Get all users having a given level

Parameters:
nIdLevel - The level
Returns:
A collection of AdminUser

updateUsersRole

public static void updateUsersRole(java.lang.String strOldRoleKey,
                                   AdminRole role)
Update role key if role key name has change

Parameters:
strOldRoleKey - The old role key name
role - The new role


Copyright © 2010 Mairie de Paris. All Rights Reserved.