Class ProfileDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.right.profile.ProfileDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
DAO for manipulating
Profile
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user provider.protected RightProfilesDAO
The SQL DAOprotected RightManager
The right managerprotected ServiceManager
The service manager -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentity
Provides the login of the current user.addProfile
(String name, String context) Creates a new profilevoid
deleteProfiles
(List<String> ids) Deletes profileseditProfileRights
(String id, List<String> rights) Edit profile's rightsgetProfile
(String id) Get profile's propertiesgetProfile
(String id, boolean withRights) Get profile's propertiesrenameProfile
(String id, String name) Renames a profilevoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_smanager
The service manager -
_currentUserProvider
The current user provider. -
_rightManager
The right manager -
_profilesDAO
The SQL DAO
-
-
Constructor Details
-
ProfileDAO
public ProfileDAO()
-
-
Method Details
-
service
- 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
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
Provides the login of the current user.- Returns:
- the login which cannot be
null
.
-