Package org.ametys.core.ui.right
Class ExternalRightsDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.right.ExternalRightsDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper to manage rights from rights.xml file
-
Field Summary
Modifier and TypeFieldDescriptionprotected RightProfilesDAO
The profile DAOprotected SourceResolver
Avalon SourceResolverprotected RightManager
The right managerprotected RightsExtensionPoint
The rights extension point -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_saxRights
(TransformerHandler handler) Sax external rights in rights.xml ?Add a right to the right EP then write it in rights.xmlGet all the right categoriesGet the set of used right idsGet the available rights for deletionremoveRight
(String id) Remove the right from the rightEP and rights.xmlvoid
service
(ServiceManager manager) protected void
Write the rights.xml file with the list of external rightsMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_rightsExtensionPoint
The rights extension point -
_rightManager
The right manager -
_profileDAO
The profile DAO -
_resolver
Avalon SourceResolver
-
-
Constructor Details
-
ExternalRightsDAO
public ExternalRightsDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getRightsCategories
Get all the right categories- Returns:
- a map of the categories' labels
-
getRightsToDelete
Get the available rights for deletion- Returns:
- a map of the rights id and label
-
addRight
Add a right to the right EP then write it in rights.xml- Parameters:
id
- the id for the new rightlabel
- the label for the new rightdescription
- the description for the new rightcategory
- the category for the new right- Returns:
- a map with an optionnal error message
-
removeRight
Remove the right from the rightEP and rights.xml- Parameters:
id
- the right to delete's id- Returns:
- a map with rightId or error message
-
writeRightsXML
Write the rights.xml file with the list of external rights- Throws:
Exception
- if an error occured
-
_saxRights
Sax external rights in rights.xml ?- Parameters:
handler
- the transformer- Throws:
SAXException
- exception during SAX
-
getRightsIds
Get the set of used right ids- Returns:
- a set of right ids
-