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,Disposable,Initializable,LogEnabled,Serviceable
- Direct Known Subclasses:
 CreateContentByCopyRightCondition
public class CreateContentRightCondition extends CheckRightsCondition
Condition for checking if an user has the right to create a content of the requested type. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint_contentTypeExtensionPointContent type extension point.protected RootContentHelper_rootContentHelperHelper for root content- 
Fields inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
__CONTEXT_KEY, __DEFAULT_CONTEXT, __RIGHT_KEY, _rightManager, FORCE 
- 
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY 
 - 
 
- 
Constructor Summary
Constructors Constructor Description CreateContentRightCondition() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()protected Set<String>getRights(Map transientVars)Get the needed right for creationprotected booleanhasRight(UserIdentity user, String right, Object context)Test if a user has a right on a context.voidinitialize()booleanpassesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps)- 
Methods inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
_checkRights, _computeContext, checkMultipleAndRights, checkMultipleOrRights 
- 
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, service 
 - 
 
 - 
 
- 
- 
Field Detail
- 
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
Content type extension point. 
- 
_rootContentHelper
protected RootContentHelper _rootContentHelper
Helper for root content 
 - 
 
- 
Constructor Detail
- 
CreateContentRightCondition
public CreateContentRightCondition()
 
 - 
 
- 
Method Detail
- 
initialize
public void initialize() throws Exception
- 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
protected boolean hasRight(UserIdentity user, String right, Object context)
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
public void dispose()
- Specified by:
 disposein interfaceDisposable- Overrides:
 disposein classCheckRightsCondition
 
 - 
 
 -