public class ProfileDAO extends AbstractLogEnabled implements Serviceable, Component
Profile
Modifier and Type | Field and Description |
---|---|
protected CurrentUserProvider |
_currentUserProvider
The current user provider.
|
protected RightProfilesDAO |
_profilesDAO
The SQL DAO
|
protected RightManager |
_rightManager
The right manager
|
protected ServiceManager |
_smanager
The service manager
|
Constructor and Description |
---|
ProfileDAO() |
Modifier and Type | Method and Description |
---|---|
protected UserIdentity |
_getCurrentUser()
Provides the login of the current user.
|
Map<String,Object> |
addProfile(String name,
String context)
Creates a new profile
|
void |
deleteProfiles(List<String> ids)
Deletes profiles
|
Map<String,Object> |
editProfileRights(String id,
List<String> rights)
Edit profile's rights
|
Map<String,Object> |
getProfile(String id)
Get profile's properties
|
Map<String,Object> |
getProfile(String id,
boolean withRights)
Get profile's properties
|
Map<String,Object> |
renameProfile(String id,
String name)
Renames a profile
|
void |
service(ServiceManager smanager) |
getLogger, setLogger
protected ServiceManager _smanager
protected CurrentUserProvider _currentUserProvider
protected RightManager _rightManager
protected RightProfilesDAO _profilesDAO
public ProfileDAO()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getProfile(String id) throws ServiceException, InvalidModificationException
id
- The profile's idInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerpublic Map<String,Object> getProfile(String id, boolean withRights) throws ServiceException, InvalidModificationException
id
- The profile's idwithRights
- True to also get the rights of the profileInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerpublic Map<String,Object> addProfile(String name, String context) throws ServiceException, InvalidModificationException
name
- The profile's namecontext
- The profile's contextInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerpublic Map<String,Object> renameProfile(String id, String name) throws ServiceException, InvalidModificationException
id
- The profile's idname
- The profile's new nameInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerpublic Map<String,Object> editProfileRights(String id, List<String> rights) throws ServiceException, InvalidModificationException
id
- The profile's idrights
- The profile's rightsInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerpublic void deleteProfiles(List<String> ids) throws InvalidModificationException, ServiceException
ids
- The ids of profiles to deleteInvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service managerprotected UserIdentity _getCurrentUser()
null
.