Dangling workflow states are not removed from user role permission

Created on 7 August 2023, about 1 year ago

Problem/Motivation

When a workflow state is removed from a workflow the user permissions are not updated but should be if a user role had access to that transition.

Steps to reproduce

Add a workflow with 3 states (published, draft and archived) with transitions between them. Grant a user role the permission to use that transitions. Then delete the archived state and transition.

When you now head to the user role permissions page and click save you will be greeted with an exception:
RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "use editorial transition archive". in Drupal\user\Entity\Role->calculateDependencies() (line 207 of core/modules/user/src/Entity/Role.php).

Proposed resolution

Re-do the user group permissions after save of a workflow.

🐛 Bug report
Status

Active

Version

10.1

Component
Workflows 

Last updated 6 months ago

Created by

🇨🇭Switzerland yobottehg Basel

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

Comments & Activities

Production build 0.71.5 2024