Package org.ametys.cms.workflow
Class CreateContentRightCondition
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.plugins.workflow.component.CheckRightsCondition
org.ametys.cms.workflow.CreateContentRightCondition
- All Implemented Interfaces:
com.opensymphony.workflow.Condition,EnhancedCondition,Disposable,Initializable,LogEnabled,Serviceable
- Direct Known Subclasses:
CreateContentByCopyRightCondition
Condition for checking if an user has the right to create a content of the requested type.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPointContent type extension point.protected RootContentHelperHelper for root contentFields inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
__CONTEXT_KEY, __DEFAULT_CONTEXT, __RIGHT_KEY, _i18nUtils, _rightManager, _rightsExtensionPoint, FORCEFields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_VALIDATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected I18nizableText_getMultipleConditionsDescriptionKey(List<String> parameters) Get condition description when there are multiple rights involvedprotected I18nizableText_getSingleConditionDescriptionKey(List<String> parameters) Get condition description when there is one rightvoiddispose()getFullLabel(Map<String, String> argumentsValues) Get the condition label depending on arguments valuesgetLabel()Get the label for this conditionGet the needed right for creationprotected booleanhasRight(UserIdentity user, String right, Object context) Test if a user has a right on a context.voidbooleanpassesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) Methods inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
_checkRights, _computeContext, _getRightsEnumerator, checkMultipleAndRights, checkMultipleOrRights, getArgumentsMethods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, serviceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.workflow.EnhancedCondition
getVisibilities
-
Field Details
-
_contentTypeExtensionPoint
Content type extension point. -
_rootContentHelper
Helper for root content
-
-
Constructor Details
-
CreateContentRightCondition
public CreateContentRightCondition()
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classCheckRightsCondition- Throws:
Exception
-
passesCondition
public boolean passesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException - Specified by:
passesConditionin interfacecom.opensymphony.workflow.Condition- Overrides:
passesConditionin classCheckRightsCondition- Throws:
com.opensymphony.workflow.WorkflowException
-
hasRight
Description copied from class:CheckRightsConditionTest if a user has a right on a context.- Overrides:
hasRightin classCheckRightsCondition- Parameters:
user- the userright- the right to check.context- the right context.- Returns:
- true if the user has the right, false otherwise.
-
getRights
protected Set<String> getRights(Map transientVars) throws com.opensymphony.workflow.WorkflowException Get the needed right for creation- Parameters:
transientVars- variables that will not be persisted.- Returns:
- The required right
- Throws:
com.opensymphony.workflow.WorkflowException- If an error occured
-
dispose
- Specified by:
disposein interfaceDisposable- Overrides:
disposein classCheckRightsCondition
-
getLabel
Description copied from interface:EnhancedConditionGet the label for this condition- Specified by:
getLabelin interfaceEnhancedCondition- Overrides:
getLabelin classCheckRightsCondition- Returns:
- the label
-
_getMultipleConditionsDescriptionKey
Description copied from class:CheckRightsConditionGet condition description when there are multiple rights involved- Overrides:
_getMultipleConditionsDescriptionKeyin classCheckRightsCondition- Parameters:
parameters- list of rights- Returns:
- the description
-
_getSingleConditionDescriptionKey
Description copied from class:CheckRightsConditionGet condition description when there is one right- Overrides:
_getSingleConditionDescriptionKeyin classCheckRightsCondition- Parameters:
parameters- the right label as a List- Returns:
- the description
-
getFullLabel
Description copied from interface:EnhancedConditionGet the condition label depending on arguments values- Specified by:
getFullLabelin interfaceEnhancedCondition- Overrides:
getFullLabelin classCheckRightsCondition- Parameters:
argumentsValues- a map of the arguments with their values in current workflow- Returns:
- a label to display in workflow editor vue
-