RuntimeException: Adding non-existent permissions to a role is not allowed.

Created on 30 April 2024, 11 months ago
Updated 14 June 2024, 10 months ago

Problem/Motivation

Permissions granted for a given entityqueue are not removed when that entityqueue is deleted. Subsequent attempts to update a role with one of the now "non-existent" permissions results in:

RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "update [entityqueue_machine_name_here] entityqueue". in Drupal\user\Entity\Role->calculateDependencies() (line 207 of core/modules/user/src/Entity/Role.php).

I think this is because entityqueue does not create a dependency on the specific entityqueue in the role.

Steps to reproduce

  1. Assign a permission (e.g. "update example_entityqueue entityqueue") to a role.
  2. Delete example_entityqueue
  3. Attempt to change the permissions on the role in step one.

Proposed resolution

Some other similar issues for reference:
πŸ’¬ RuntimeException: Adding non-existent permissions to a role is not allowed Active
πŸ› RuntimeException: Adding non-existent permissions to a role is not allowed. Needs review
πŸ› RuntimeException: Adding non-existent permissions to a role is not allowed. Active

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

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

Comments & Activities

Production build 0.71.5 2024