fr.paris.lutece.portal.business.user
Interface IAdminUserDAO

All Known Implementing Classes:
AdminUserDAO

public interface IAdminUserDAO

AdminUserDAO Interface


Method Summary
 int checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
          Checks the availibility of an access code
 int checkEmailAlreadyInUse(java.lang.String strEmail)
          Checks the availibility of an email
 boolean checkRoleAttributed(java.lang.String strRoleKey)
          Checks wether the role is in use or not
 void delete(int nUserId)
          Delete an user
 void deleteAllDelegatedRightsForUser(int nUserId, int nUserLevel)
          Deletes rights delegated by user ie rights with level < userlevel
 void deleteAllOwnRightsForUser(int nUserId, int nUserLevel)
          Deletes all rights owned by user ie rights with level >= userlevel
 void deleteAllRightsForUser(int nUserId)
          Delete all rights owned by an user
 void deleteAllRolesForUser(int nUserId)
          Remove all rights from an user
 void deleteRightForUser(int nUserId, java.lang.String strIdRight)
          Remove a right for an user
 void deleteRoleForUser(int nUserId, java.lang.String strRoleKey)
          Remove role for an user
 boolean hasRight(int nUserId, java.lang.String strIdRight)
          Check if the user has the given right
 boolean hasRole(int nUserId, java.lang.String strRoleKey)
          Check if the user has the role
 void insert(AdminUser user)
          Insert a new record in the table.
 void insert(LuteceDefaultAdminUser user)
          Insert a new record in the table.
 void insertRightsListForUser(int nUserId, java.lang.String strRightId)
          Add a right to an user
 void insertRolesListForUser(int nUserId, java.lang.String strRoleKey)
          Gives a role to an user
 AdminUser load(int nUserId)
          Load an AdminUser
 LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
          Load a default AdminUser
 int newPrimaryKey()
          Generates a new primary key
 java.util.Map<java.lang.String,Right> selectRightsListForUser(int nUserId)
          Get the right list associated to a given user id
 java.util.Map<java.lang.String,AdminRole> selectRolesListForUser(int nUserId)
          Get the role list associated to a given user id
 AdminUser selectUserByAccessCode(java.lang.String strUserAccessCode)
          Get an user by its access code (login)
 java.util.Collection<AdminUser> selectUserList()
          Gets the collection of all AdminUsers
 java.util.Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
          Select users by filter
 java.util.Collection<AdminUser> selectUsersByLevel(int nIdLevel)
          Select all user that own a given level
 java.util.Collection<AdminUser> selectUsersByRight(java.lang.String strIdRight)
          Get all users having a given right
 java.util.Collection<AdminUser> selectUsersByRole(java.lang.String strRoleKey)
          Gets a collection of AdminUser that share a given role
 void store(AdminUser user)
          Update AdminUser data
 void store(LuteceDefaultAdminUser user)
          Update AdminUser data
 void storeUsersRole(java.lang.String strOldRoleKey, AdminRole role)
          Update role key if role key name has change
 

Method Detail

checkAccessCodeAlreadyInUse

int checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
Checks the availibility of an access code

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

checkEmailAlreadyInUse

int checkEmailAlreadyInUse(java.lang.String strEmail)
Checks the availibility of an email

Parameters:
strEmail - The email
Returns:
True if the email is already used by another user

checkRoleAttributed

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

Parameters:
strRoleKey - the role key to check
Returns:
user ID if the emaile is already used by another user, -1 otherwise

delete

void delete(int nUserId)
Delete an user

Parameters:
nUserId - the user id

deleteAllDelegatedRightsForUser

void deleteAllDelegatedRightsForUser(int nUserId,
                                     int nUserLevel)
Deletes rights delegated by user ie rights with level < userlevel

Parameters:
nUserId - the user id
nUserLevel - the user level

deleteAllOwnRightsForUser

void deleteAllOwnRightsForUser(int nUserId,
                               int nUserLevel)
Deletes all rights owned by user ie rights with level >= userlevel

Parameters:
nUserId - the user id
nUserLevel - the user level

deleteAllRightsForUser

void deleteAllRightsForUser(int nUserId)
Delete all rights owned by an user

Parameters:
nUserId - the user id

deleteAllRolesForUser

void deleteAllRolesForUser(int nUserId)
Remove all rights from an user

Parameters:
nUserId - the user id

insert

void insert(AdminUser user)
Insert a new record in the table.

Parameters:
user - The AdminUser

insert

void insert(LuteceDefaultAdminUser user)
Insert a new record in the table.

Parameters:
user - The AdminUser

insertRightsListForUser

void insertRightsListForUser(int nUserId,
                             java.lang.String strRightId)
Add a right to an user

Parameters:
nUserId - the user id
strRightId - the right id

insertRolesListForUser

void insertRolesListForUser(int nUserId,
                            java.lang.String strRoleKey)
Gives a role to an user

Parameters:
nUserId - the user id
strRoleKey - the key role

load

AdminUser load(int nUserId)
Load an AdminUser

Parameters:
nUserId - the user id
Returns:
user

loadDefaultAdminUser

LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
Load a default AdminUser

Parameters:
nUserId - the user id
Returns:
user

newPrimaryKey

int newPrimaryKey()
Generates a new primary key

Returns:
nKey

selectRightsListForUser

java.util.Map<java.lang.String,Right> selectRightsListForUser(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 as a collection of strings

selectRolesListForUser

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

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

selectUserByAccessCode

AdminUser selectUserByAccessCode(java.lang.String strUserAccessCode)
Get an user by its access code (login)

Parameters:
strUserAccessCode - the login
Returns:
The user found, otherwise null

selectUserList

java.util.Collection<AdminUser> selectUserList()
Gets the collection of all AdminUsers

Returns:
The user list

selectUsersByRole

java.util.Collection<AdminUser> selectUsersByRole(java.lang.String strRoleKey)
Gets a collection of AdminUser that share a given role

Parameters:
strRoleKey - The role key
Returns:
The user List

store

void store(AdminUser user)
Update AdminUser data

Parameters:
user - The AdminUser

store

void store(LuteceDefaultAdminUser user)
Update AdminUser data

Parameters:
user - The AdminUser

selectUsersByLevel

java.util.Collection<AdminUser> selectUsersByLevel(int nIdLevel)
Select all user that own a given level

Parameters:
nIdLevel - The level
Returns:
userList The user's list

storeUsersRole

void storeUsersRole(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

hasRole

boolean hasRole(int nUserId,
                java.lang.String strRoleKey)
Check if the user has the role

Parameters:
nUserId - The ID of the user
strRoleKey - The role Key
Returns:
true if the user has the role

deleteRoleForUser

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

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

selectUsersByFilter

java.util.Collection<AdminUser> selectUsersByFilter(AdminUserFilter auFilter)
Select users by filter

Parameters:
auFilter - the filter
Returns:
a list of AdminUser

selectUsersByRight

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

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

hasRight

boolean hasRight(int nUserId,
                 java.lang.String strIdRight)
Check if the user has the given right

Parameters:
nUserId - The ID of the user
strIdRight - The ID right
Returns:
true if the user has the right

deleteRightForUser

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

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


Copyright © 2012 Mairie de Paris. All Rights Reserved.