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> findByRight(java.lang.String strIdRight)
          Get all users having a given right
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 java.util.Collection<AdminUser> findUserByFilter(AdminUserFilter auFilter)
          Get all users by using a filter.
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 boolean hasRight(AdminUser user, java.lang.String strIdRight)
          Check if the user has the given right
static boolean hasRole(AdminUser user, java.lang.String strRoleKey)
          Check if the user has the role
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 removeRightForUser(int nUserId, java.lang.String strIdRight)
          Remove a right for an user
static void removeRoleForUser(int nUserId, java.lang.String strRoleKey)
          Remove role for an user
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

hasRole

public static boolean hasRole(AdminUser user,
                              java.lang.String strRoleKey)
Check if the user has the role

Parameters:
user - The AdminUser
strRoleKey - The role Key
Returns:
true if the user has the role

removeRoleForUser

public static void removeRoleForUser(int nUserId,
                                     java.lang.String strRoleKey)
Remove role for an user

Parameters:
nUserId - The ID of the user
strRoleKey - The role key

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

findUserByFilter

public static java.util.Collection<AdminUser> findUserByFilter(AdminUserFilter auFilter)
Get all users by using a filter.

Parameters:
auFilter - The filter
Returns:
A collection of AdminUser

findByRight

public static java.util.Collection<AdminUser> findByRight(java.lang.String strIdRight)
Get all users having a given right

Parameters:
strIdRight - The ID right
Returns:
A collection of AdminUser

hasRight

public static boolean hasRight(AdminUser user,
                               java.lang.String strIdRight)
Check if the user has the given right

Parameters:
user - The Admin User
strIdRight - The ID right
Returns:
true if the user has the right

removeRightForUser

public static void removeRightForUser(int nUserId,
                                      java.lang.String strIdRight)
Remove a right for an user

Parameters:
nUserId - The user ID
strIdRight - The right ID


Copyright © 2010 Mairie de Paris. All Rights Reserved.