Class ProfileDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.right.profile.ProfileDAO
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ProfileDAO extends AbstractLogEnabled implements Serviceable, Component
DAO for manipulatingProfile
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user provider.protected RightProfilesDAO
_profilesDAO
The SQL DAOprotected RightManager
_rightManager
The right managerprotected ServiceManager
_smanager
The service manager
-
Constructor Summary
Constructors Constructor Description ProfileDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UserIdentity
_getCurrentUser()
Provides the login of the current user.Map<String,Object>
addProfile(String name, String context)
Creates a new profilevoid
deleteProfiles(List<String> ids)
Deletes profilesMap<String,Object>
editProfileRights(String id, List<String> rights)
Edit profile's rightsMap<String,Object>
getProfile(String id)
Get profile's propertiesMap<String,Object>
getProfile(String id, boolean withRights)
Get profile's propertiesMap<String,Object>
renameProfile(String id, String name)
Renames a profilevoid
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_smanager
protected ServiceManager _smanager
The service manager
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider.
-
_rightManager
protected RightManager _rightManager
The right manager
-
_profilesDAO
protected RightProfilesDAO _profilesDAO
The SQL DAO
-
-
Constructor Detail
-
ProfileDAO
public ProfileDAO()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getProfile
public Map<String,Object> getProfile(String id) throws ServiceException, InvalidModificationException
Get profile's properties- Parameters:
id
- The profile's id- Returns:
- The profile's information
- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
getProfile
public Map<String,Object> getProfile(String id, boolean withRights) throws ServiceException, InvalidModificationException
Get profile's properties- Parameters:
id
- The profile's idwithRights
- True to also get the rights of the profile- Returns:
- The profile's information
- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
addProfile
public Map<String,Object> addProfile(String name, String context) throws ServiceException, InvalidModificationException
Creates a new profile- Parameters:
name
- The profile's namecontext
- The profile's context- Returns:
- The profile's information
- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
renameProfile
public Map<String,Object> renameProfile(String id, String name) throws ServiceException, InvalidModificationException
Renames a profile- Parameters:
id
- The profile's idname
- The profile's new name- Returns:
- The profile's information
- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
editProfileRights
public Map<String,Object> editProfileRights(String id, List<String> rights) throws ServiceException, InvalidModificationException
Edit profile's rights- Parameters:
id
- The profile's idrights
- The profile's rights- Returns:
- The profile's information
- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
deleteProfiles
public void deleteProfiles(List<String> ids) throws InvalidModificationException, ServiceException
Deletes profiles- Parameters:
ids
- The ids of profiles to delete- Throws:
InvalidModificationException
- If modification are not possibleServiceException
- If there is an issue with the service manager
-
_getCurrentUser
protected UserIdentity _getCurrentUser()
Provides the login of the current user.- Returns:
- the login which cannot be
null
.
-
-