Class IsUserCondition
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.forms.workflow.IsUserCondition
- All Implemented Interfaces:
com.opensymphony.workflow.Condition,FormEntryCondition,EnhancedCondition,LogEnabled,Serviceable
public class IsUserCondition
extends AbstractLogEnabled
implements EnhancedCondition, FormEntryCondition, Serviceable
Worklow condition for checking if current user is the same user as an user defined in a question
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected UserManagerThe user managerstatic final StringThe question name argument -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of accepted arguments for this conditiongetFullLabel(Map<String, String> argumentsValues) Get the condition label depending on arguments valuesgetLabel()Get the label for this conditionprotected Set<UserIdentity> getUsersFromEntry(FormEntry formEntry, Map args) Get the set of users defined in the given question of the form entryGet the condition's visibilities depending on rightsgetWorkflowActorsPermissions(FormEntry entry, Map args) Returns all users with their corresponding permission result.booleanpassesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) voidservice(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.forms.workflow.FormEntryCondition
getAnyConnectedPermissions
-
Field Details
-
QUESTION_NAME
The question name argument- See Also:
-
_userManager
The user manager -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
IsUserCondition
public IsUserCondition()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
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- Throws:
com.opensymphony.workflow.WorkflowException
-
getArguments
Description copied from interface:EnhancedConditionGet the list of accepted arguments for this condition- Specified by:
getArgumentsin interfaceEnhancedCondition- Returns:
- a List of argument names and associated description
-
getLabel
Description copied from interface:EnhancedConditionGet the label for this condition- Specified by:
getLabelin interfaceEnhancedCondition- Returns:
- the label
-
getFullLabel
Description copied from interface:EnhancedConditionGet the condition label depending on arguments values- Specified by:
getFullLabelin interfaceEnhancedCondition- Parameters:
argumentsValues- a map of the arguments with their values in current workflow- Returns:
- a label to display in workflow editor vue
-
getVisibilities
Description copied from interface:EnhancedConditionGet the condition's visibilities depending on rights- Specified by:
getVisibilitiesin interfaceEnhancedCondition- Returns:
- a list of all the allowed right profiles
-
getWorkflowActorsPermissions
public Map<UserIdentity,RightManager.RightResult> getWorkflowActorsPermissions(FormEntry entry, Map args) Description copied from interface:FormEntryConditionReturns all users with their corresponding permission result. The associatedRightManager.RightResultindicates whether the user passes the condition or not.- Specified by:
getWorkflowActorsPermissionsin interfaceFormEntryCondition- Parameters:
entry- the form entryargs- the condition arguments- Returns:
- a map containing each evaluated user and their corresponding
RightManager.RightResult
-
getUsersFromEntry
Get the set of users defined in the given question of the form entry- Parameters:
formEntry- the form entry to get the users fromargs- the condition arguments containing the question name- Returns:
- the set of users defined in the given question of the form entry, or an empty set if the question is not valid
-