Class FormCheckRightsCondition
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.plugins.workflow.component.CheckRightsCondition
org.ametys.cms.workflow.AmetysObjectCheckRightsCondition
org.ametys.plugins.forms.workflow.FormCheckRightsCondition
- All Implemented Interfaces:
com.opensymphony.workflow.Condition,FormEntryCondition,EnhancedCondition,Disposable,Initializable,LogEnabled,Serviceable
public class FormCheckRightsCondition
extends AmetysObjectCheckRightsCondition
implements FormEntryCondition
Worklow condition for checking rights on form entry
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure -
Field Summary
FieldsFields inherited from class org.ametys.cms.workflow.AmetysObjectCheckRightsCondition
AMETYS_OBJECT_KEYFields 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 StaticEnumeratorGet the rights enumeratorprotected I18nizableText_getSingleConditionDescriptionKey(List<String> parameters) Get condition description when there is one rightprotected booleancheckAnyConnectedRightOnForm(Form form, Map args) Check for any connected a right (or combination of rights separated by '|' or '&') on a form entryprotected Map<UserIdentity, RightManager.RightResult> collectANDFromAllowedUsers(Form form, String[] rights) CollectUserIdentitywith theirRightManager.RightResultwith AND semantics, using merge strategy where DENY wins.protected Map<UserIdentity, RightManager.RightResult> collectFromAllowedUsers(Form form, String rightNeeded) CollectUserIdentitywith theirRightManager.RightResultfromAllowedUsersfor a right (or combination of rights separated by '|' or '&') on a formprotected Map<UserIdentity, RightManager.RightResult> collectORFromAllowedUsers(Form form, String[] rights) CollectUserIdentitywith theirRightManager.RightResultwith OR semantics, using merge strategy where ALLOW wins.getAnyConnectedPermissions(FormEntry entry, Map args) Get the right result for any connected user passes the condition on the form entryGet the list of accepted arguments for this conditiongetLabel()Get the label for this conditionGet the condition's visibilities depending on rightsgetWorkflowActorsPermissions(FormEntry entry, Map args) Returns all users with their corresponding permission result.protected booleanmultipleANDAnyConnectedRightResult(Form form, String[] rights) Check multiple rights on any connected with AND semantics: returns true only if all rights are allowed.protected booleanmultipleORAnyConnectedRightResult(Form form, String[] rights) Check multiple rights on any connected with OR semantics: returns true if any right is allowed.voidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.workflow.AmetysObjectCheckRightsCondition
_computeContext, getAmetysObjectMethods inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
_checkRights, _getMultipleConditionsDescriptionKey, checkMultipleAndRights, checkMultipleOrRights, dispose, getFullLabel, hasRight, initialize, passesConditionMethods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
Field Details
-
_formDirectoryDAO
The form directory DAO
-
-
Constructor Details
-
FormCheckRightsCondition
public FormCheckRightsCondition()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractWorkflowComponent- Throws:
ServiceException
-
getArguments
Description copied from interface:EnhancedConditionGet the list of accepted arguments for this condition- Specified by:
getArgumentsin interfaceEnhancedCondition- Overrides:
getArgumentsin classCheckRightsCondition- Returns:
- a List of argument names and associated description
-
_getRightsEnumerator
Description copied from class:CheckRightsConditionGet the rights enumerator- Overrides:
_getRightsEnumeratorin classCheckRightsCondition- Returns:
- the rights enumerator
-
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
-
getLabel
Description copied from interface:EnhancedConditionGet the label for this condition- Specified by:
getLabelin interfaceEnhancedCondition- Overrides:
getLabelin classAmetysObjectCheckRightsCondition- Returns:
- the label
-
_getSingleConditionDescriptionKey
Description copied from class:CheckRightsConditionGet condition description when there is one right- Overrides:
_getSingleConditionDescriptionKeyin classAmetysObjectCheckRightsCondition- Parameters:
parameters- the right label as a List- Returns:
- the description
-
getAnyConnectedPermissions
Description copied from interface:FormEntryConditionGet the right result for any connected user passes the condition on the form entry- Specified by:
getAnyConnectedPermissionsin interfaceFormEntryCondition- Parameters:
entry- the form entryargs- the condition arguments- Returns:
- the right result for any connected user passes the condition on the form entry
-
checkAnyConnectedRightOnForm
Check for any connected a right (or combination of rights separated by '|' or '&') on a form entry- Parameters:
form- the form to check the rights onargs- the workflow arguments containing the right key- Returns:
- true if any connected user has the right(s), false otherwise
-
multipleORAnyConnectedRightResult
Check multiple rights on any connected with OR semantics: returns true if any right is allowed.- Parameters:
form- the form to check the rights onrights- the rights to check- Returns:
- true if at least one right is allowed
-
multipleANDAnyConnectedRightResult
Check multiple rights on any connected with AND semantics: returns true only if all rights are allowed.- Parameters:
form- the form to check the rights onrights- the rights to check- Returns:
- true if all rights are allowed
-
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
-
collectFromAllowedUsers
protected Map<UserIdentity,RightManager.RightResult> collectFromAllowedUsers(Form form, String rightNeeded) CollectUserIdentitywith theirRightManager.RightResultfromAllowedUsersfor a right (or combination of rights separated by '|' or '&') on a form- Parameters:
form- the form contextrightNeeded- the right string, possibly containing '|' or '&'- Returns:
- the collected map of
UserIdentitytoRightManager.RightResult
-
collectORFromAllowedUsers
protected Map<UserIdentity,RightManager.RightResult> collectORFromAllowedUsers(Form form, String[] rights) CollectUserIdentitywith theirRightManager.RightResultwith OR semantics, using merge strategy where ALLOW wins.- Parameters:
form- the form contextrights- the rights to check, separated by '|' in the original string- Returns:
- the collected map of
UserIdentitytoRightManager.RightResult
-
collectANDFromAllowedUsers
protected Map<UserIdentity,RightManager.RightResult> collectANDFromAllowedUsers(Form form, String[] rights) CollectUserIdentitywith theirRightManager.RightResultwith AND semantics, using merge strategy where DENY wins.- Parameters:
form- the form contextrights- the rights to check, separated by '&' in the original string- Returns:
- the collected map of
UserIdentitytoRightManager.RightResult
-