Package org.ametys.odf.restriction
Class RepeaterWithEducationalPathRestriction
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.model.restrictions.DefaultRestriction
org.ametys.odf.restriction.SharedOnlyRestriction
org.ametys.odf.restriction.RepeaterWithEducationalPathRestriction
- All Implemented Interfaces:
Restriction
,LogEnabled
,Initializable
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
RepeaterWithEducationalPathRestriction
public class RepeaterWithEducationalPathRestriction
extends SharedOnlyRestriction
implements Contextualizable, Initializable
Restrictions for a repeater with educational path or for data in a repeater with educational
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.model.restrictions.Restriction
Restriction.RestrictionResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe fields handled by this restrictionFields inherited from class org.ametys.cms.model.restrictions.DefaultRestriction
_currentUserProvider, _rightManager, _workflowProvider, _writeRightIds
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Ensure the configuration of write rights is correctprotected boolean
_hasRights
(Content content, RestrictedModelItem modelItem, Set<String> rightLimitations) Check if current user has the given rights.canWrite
(Content content, RestrictedModelItem modelItem) Determine whether a model item can be written at this time.void
configure
(Configuration configuration) void
contextualize
(Context context) void
Methods inherited from class org.ametys.odf.restriction.SharedOnlyRestriction
canRead, service
Methods inherited from class org.ametys.cms.model.restrictions.DefaultRestriction
_isInWorkflowStep
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_fields
The fields handled by this restriction
-
-
Constructor Details
-
RepeaterWithEducationalPathRestriction
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classSharedOnlyRestriction
- Throws:
ConfigurationException
-
_checkWriteRights
Ensure the configuration of write rights is correct- Throws:
ConfigurationException
- If the configuration is incorrect
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
canWrite
Description copied from interface:Restriction
Determine whether a model item can be written at this time.- Specified by:
canWrite
in interfaceRestriction
- Overrides:
canWrite
in classDefaultRestriction
- Parameters:
content
- The content where item is to be written on. Can be null, on content creation.modelItem
- the model item on which check the restrictions- Returns:
- The restriction result
-
_hasRights
protected boolean _hasRights(Content content, RestrictedModelItem modelItem, Set<String> rightLimitations) Description copied from class:DefaultRestriction
Check if current user has the given rights.- Overrides:
_hasRights
in classDefaultRestriction
- Parameters:
content
- the content.modelItem
- the model item on which check the restrictionsrightLimitations
- the right limitations.- Returns:
true
if user has at least one right,false
otherwise.
-