ECA Workflow: Action to set access to transition

Created on 3 June 2024, 24 days ago
Updated 18 June 2024, 9 days ago

I'd like to be able to conditionally set access to a workflow transition.

Use case: We have a content type for grant applications. Applications are only accepted during certain times of year. Applicants can save drafts any time, but the "Submit application" transition should only be available when the application window is open.

It would be great if there was a way to modify the allowed transitions.

πŸ’¬ Support request
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jvogt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jvogt
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Is this in the context of the 2 core modules content_moderation and workflow? If so, I guess this needs some enhancement in Drupal core first, because the permissions for transitions can not be altered. I looked into \Drupal\content_moderation\StateTransitionValidation and there isn't any hook or event, which would allow ECA to hook into that.

    However, the permissions for each transition are granted to user roles. Those user roles are config entities, and those can be modified by ECA. That said, you could use ECA to remove that permission from the role(s) at the end of the application window and re-grant that permission to the role(s) when that window opens again.

  • πŸ‡ΊπŸ‡ΈUnited States jvogt

    Yep, it's those two core modules. I think your suggestion will work for us. Thanks for your insights!

  • Status changed to Fixed 23 days ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks for your feedback. Closing as fixed.

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

Production build 0.69.0 2024