Package org.ametys.core.right
Class RightProfilesDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.datasource.AbstractMyBatisDAO
org.ametys.core.right.RightProfilesDAO
- All Implemented Interfaces:
LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
Manages registration of profiles
-
Field Summary
FieldsFields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProfile(String label) Creates a new profile with null context.addProfile(String label, String context) Creates a new profile.addProfile(String id, String label, String context) Creates a new profilevoidaddProfile(Profile profile) Add a new profilevoidaddProfile(Profile profile, boolean silent) Add a new profilevoidAdd a right to a profilevoidAdd a right to a profilevoidClear the profiles cachevoiddeleteProfile(Profile profile) Delete a profilevoiddeleteProfile(Profile profile, boolean silent) Delete a profilegetProfile(String id) Get the profile with given identifierGet all existing profilesgetProfiles(String context) Get the profiles on a given contextgetProfilesWithRight(String rightId) Get all profiles containing the right with given idGet the rights of a profileGet the rights of a profilevoidvoidremoveRight(Profile profile, String rightId) Remove a right from a profilevoidremoveRight(Profile profile, String rightId, boolean silent) Remove a right from a profilevoidremoveRights(Profile profile) Add a right to a profilevoidremoveRights(Profile profile, boolean silent) Add a right to a profilevoidrenameProfile(Profile profile, String newLabel) Rename a profilevoidrenameProfile(Profile profile, String newLabel, boolean silent) Rename a profilevoidservice(ServiceManager smanager) voidupdateRights(Profile profile, List<String> rights) Update the rights of a profilevoidupdateRights(Profile profile, List<String> rights, boolean silent) Update the rights of a profileMethods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, _getMyBatisConfiguration, configure, contextualize, getSession, getSession, reload, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role.
-
-
Constructor Details
-
RightProfilesDAO
public RightProfilesDAO()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractMyBatisDAO- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
clearCache
Clear the profiles cache -
getProfiles
Get all existing profiles- Returns:
- The list for profiles
-
getProfiles
Get the profiles on a given context- Parameters:
context- The context. Can be null. If null, the profiles with no context are returned.- Returns:
- The list for profiles for this context
-
getProfile
Get the profile with given identifier- Parameters:
id- The id of profile to retrieve- Returns:
- The profile
-
getProfilesWithRight
Get all profiles containing the right with given id- Parameters:
rightId- The id of right- Returns:
- The id of profiles with this right
-
addProfile
Creates a new profile with null context. The identifier of the profile will be automatically generated from label.- Parameters:
label- The label of profile- Returns:
- The create profile
-
addProfile
Creates a new profile. The identifier of the profile will be automatically generated from label.- Parameters:
label- The label of profilecontext- The context. Can be null- Returns:
- The create profile
-
addProfile
Creates a new profile- Parameters:
id- The unique identifier of profilelabel- The label of profilecontext- The context. Can be null- Returns:
- The create profile
-
addProfile
Add a new profile- Parameters:
profile- The profile to addsilent- Set to true to not notify observer of this update
-
addProfile
Add a new profile- Parameters:
profile- The profile to add
-
renameProfile
Rename a profile- Parameters:
profile- The profile to renamenewLabel- The updated label
-
renameProfile
Rename a profile- Parameters:
profile- The profile to renamenewLabel- The updated labelsilent- Set to true to not notify observer of this update
-
getRights
Get the rights of a profile- Parameters:
profileId- The profile id- Returns:
- The rights
-
getRights
Get the rights of a profile- Parameters:
profile- The profile- Returns:
- The rights
-
addRight
Add a right to a profile- Parameters:
profile- The profilerightId- The id of right to add
-
addRights
Add a right to a profile- Parameters:
profile- The profilerightIds- The id of rights to add
-
updateRights
Update the rights of a profile- Parameters:
profile- The profilerights- The rights of the profile
-
updateRights
Update the rights of a profile- Parameters:
profile- The profilerights- The rights of the profilesilent- Set to true to not notify observer of this update
-
removeRights
Add a right to a profile- Parameters:
profile- The profile
-
removeRights
Add a right to a profile- Parameters:
profile- The profilesilent- Set to true to not notify observer of this update
-
removeRight
Remove a right from a profile- Parameters:
profile- The profilerightId- The id of right to add
-
removeRight
Remove a right from a profile- Parameters:
profile- The profilerightId- The id of right to addsilent- Set to true to not notify observer of this update
-
deleteProfile
Delete a profile- Parameters:
profile- The profile to delete
-
deleteProfile
Delete a profile- Parameters:
profile- The profile to deletesilent- Set to true to not notify observer of this update
-