Comments

Sam152 created an issue. See original summary.

collin.rickford’s picture

Version: » 8.x-1.x-dev
StatusFileSize
new4.33 KB

Here is a patch which adds and enforces permissions on transitions, per workflow.

sam152’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Nice! We'll need some tests for this though.

benjy’s picture

StatusFileSize
new6.21 KB
new4.08 KB

I've attached a new patch that adds the access control to the widget as well, still need some tests. One of the existing tests did pick up the error below.

+++ b/src/Plugin/Validation/Constraint/WorkflowsFieldContraintValidator.php
@@ -61,6 +70,14 @@ class WorkflowsFieldContraintValidator extends ConstraintValidator implements Co
+      $transition = $workflow_type->getTransitionFromStateToState($previous_state, $field->state);

This is wrong it should have been $field->value.

Tests still failing because they trigger the new violation. Will pick it up tomorrow.

sam152’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: 2904573-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new13.1 KB
new8.2 KB

I pulled the constraint tests into their own class since they now handle users and permissions. I've added a new test for the constraint and additional tests for getSettableOptions. Everything should be green.

sam152’s picture

This looks awesome!

  • Sam152 committed 9385d29 on 8.x-1.x authored by benjy
    Issue #2904573 by benjy, collin.rickford: Add permissions for states or...
sam152’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

CraigBertrand’s picture

I don't see any permissions for each state. Do I need to do something special to turn on the permissions?

CraigBertrand’s picture

Nevermind, If anyone else is not seeing the permissions per state, you need to use the dev version of the module.