public class UserDAO extends AbstractLogEnabled implements Component, Contextualizable, Serviceable
User
Modifier and Type | Class and Description |
---|---|
static class |
UserDAO.ImpersonateCredentialProvider
A fake credential provider used by the impersonate process
|
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
The Avalon context
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider.
|
protected RightManager |
_rightManager
The right manager
|
protected ServiceManager |
_smanager
The service manager
|
protected UserHelper |
_userHelper
The user helper
|
protected UserManager |
_userManager
The user manager
|
protected UserPopulationDAO |
_userPopulationDAO
The user population DAO
|
static String |
ROLE
The avalon role
|
Constructor and Description |
---|
UserDAO() |
Modifier and Type | Method and Description |
---|---|
private void |
_deleteUser(String login,
String populationId) |
protected UserIdentity |
_getCurrentUser()
Provides the login of the current user.
|
private Map<String,Object> |
_getEditionModel(UserDirectory userDirectory) |
Map<String,Object> |
addUser(String populationId,
String userDirectoryId,
Map<String,String> untypedValues)
Creates a User
|
void |
contextualize(Context context) |
void |
deleteUsers(List<Map<String,String>> users)
Deletes users
|
Map<String,Object> |
editUser(String populationId,
Map<String,String> untypedValues)
Edits a User
|
Map<String,Object> |
getEditionModelForDirectory(String populationId,
String userDirectoryId)
Get the users edition model
|
Map<String,Object> |
getEditionModelForUSer(String login,
String populationId)
Get the users edition model
|
Map<String,Object> |
getUser(String login,
String populationId)
Get user's information
|
Map<String,String> |
impersonate(String login,
String populationId)
Impersonate the selected user
|
Map<String,Object> |
isModifiable(String login,
String populationId)
Checks if the user is modifiable
|
Map<String,Object> |
isRemovable(String login,
String populationId)
Checks if the user is removable
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ServiceManager _smanager
protected UserManager _userManager
protected UserPopulationDAO _userPopulationDAO
protected CurrentUserProvider _currentUserProvider
protected UserHelper _userHelper
protected RightManager _rightManager
public UserDAO()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getUser(String login, String populationId)
login
- The user's loginpopulationId
- The id of the populationpublic Map<String,Object> isModifiable(String login, String populationId)
login
- The users's loginpopulationId
- The id of the population of the userpublic Map<String,Object> isRemovable(String login, String populationId)
login
- The users's loginpopulationId
- The id of the population of the userpublic Map<String,Object> addUser(String populationId, String userDirectoryId, Map<String,String> untypedValues) throws InvalidModificationException
populationId
- The id of the user populationuserDirectoryId
- The id of the user directoryuntypedValues
- The untyped user's parametersInvalidModificationException
- If modification is not possiblepublic Map<String,Object> editUser(String populationId, Map<String,String> untypedValues) throws InvalidModificationException
populationId
- The id of the population of the user to edituntypedValues
- The untyped user's parametersInvalidModificationException
- If modification is not possiblepublic void deleteUsers(List<Map<String,String>> users) throws InvalidModificationException
users
- The users to deleteInvalidModificationException
- If modification is not possibleprivate void _deleteUser(String login, String populationId) throws InvalidModificationException
InvalidModificationException
public Map<String,Object> getEditionModelForUSer(String login, String populationId) throws InvalidModificationException, ProcessingException
login
- The user's login to editpopulationId
- The id of the population of the user to editInvalidModificationException
- If modification is not possibleProcessingException
- If there is another exceptionpublic Map<String,Object> getEditionModelForDirectory(String populationId, String userDirectoryId) throws InvalidModificationException, ProcessingException
populationId
- The id of the population where to add a useruserDirectoryId
- The id of the user directory where to add a userInvalidModificationException
- If modification is not possibleProcessingException
- If there is another exceptionprivate Map<String,Object> _getEditionModel(UserDirectory userDirectory) throws InvalidModificationException, ProcessingException
public Map<String,String> impersonate(String login, String populationId) throws AccessDeniedException
login
- the login of the user to impersonatepopulationId
- The id of the populationAccessDeniedException
- If the currently connected user has no right to do soprotected UserIdentity _getCurrentUser()
null
.