Class ContentRestrictedModelItemHelper
java.lang.Object
org.ametys.cms.model.restrictions.ContentRestrictedModelItemHelper
- All Implemented Interfaces:
- Component,- Serviceable
Helper for definitions with restrictions on contents
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription_parseRestrictions(Configuration configuration) Parses the attribute definition's restrictions.booleancanRead(Content content, ModelItem item, Restrictions restrictions) Determine whether a model item can be read at this time.booleancanWrite(Content content, ModelItem item, Restrictions restrictions) Determine whether a model item can be written at this time.voidservice(ServiceManager manager) 
- 
Field Details- 
ROLEThe Avalon role name
 
- 
- 
Constructor Details- 
ContentRestrictedModelItemHelperpublic ContentRestrictedModelItemHelper()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
canReadpublic boolean canRead(Content content, ModelItem item, Restrictions restrictions) throws AmetysRepositoryException Determine whether a model item can be read at this time.- Parameters:
- item- the model item on which check the restrictions
- content- The content where item is to be written on. Can be null, on content creation.
- restrictions- the restrictions to check
- Returns:
- trueif the current user is allowed to write the model item of this content.
- Throws:
- AmetysRepositoryException- if an error occurs while accessing the content workflow.
 
- 
canWritepublic boolean canWrite(Content content, ModelItem item, Restrictions restrictions) throws AmetysRepositoryException Determine whether a model item can be written at this time.- Parameters:
- item- the model item on which check the restrictions
- content- The content where item is to be written on. Can be null, on content creation.
- restrictions- the restrictions to check
- Returns:
- trueif the current user is allowed to write the model item of this content.
- Throws:
- AmetysRepositoryException- if an error occurs while accessing the content workflow.
 
- 
_parseRestrictionsParses the attribute definition's restrictions.- Parameters:
- configuration- the configuration of the element that have content restrictions
- Returns:
- the parsed restrictions.
- Throws:
- ConfigurationException- if the configuration is not valid.
 
 
-