Role/Permission are added to multiple splits

Created on 21 September 2022, about 2 years ago
Updated 21 October 2023, about 1 year ago

Problem/Motivation

Not sure if we're the only ones, but we have multiple roles which overlap in the permissions.
Like "Content Editors" and "Content Reviewers" being allowed to view all unpublished content (and edit them, do the whole content-workflow-fun).
We also split the content types into their own features. Like a "FAQ"-Feature containing a "Question"-Content type and another "Guide"-Feature having "Guide-Article"-Content type.
The role "Content Editor" should be able to work with both types.

With this setup config-split 2.x behaves weird.

Config export results in the FAQ-Split having just FAQ-Permissions, which is fine, but the Guide-Split has the permission for both.
I had three Splits, and the third one had the permissions of the two and his own...

With the same weights it looks like it's going through the splits alphabetically. With weights, it does the same... but sorted by weight.

I guess some sort of... cascade is happening somewhere? Some array is not cleared? Not sure how any of this works.
(Maybe the dependencies... get confused? Because a Permission assigned to a role... expects that role to exist? I don't know.)

Steps to reproduce

  1. make sure you have 2 content types (article and page are fine)
  2. make sure you have 2 roles (content_editor and ... content_editor_2, be creative!)
  3. remove any permissions for the 2 roles (just to have a clear state)
  4. allow the two roles to create contents for both content types
  5. create 2 Splits. One for each of the content types. (same weights, different folders, both active and non-stackable [even though stackability doesn't seem to make a difference])
  6. do a config-export
  7. check the split configs.

Proposed resolution

I have no clue... don't even know the issue.

My expectation would be to have the permissions for a content-type only in the corresponding feature-split.
But not the way it was in 1.x, where the first split gets all the permissions for the roles. Having the module patch the configs together is a great idea.

Remaining tasks

1. Find the issue.
2. Fix the issue.
3. Be happy.

User interface changes

None.

API changes

None?

Data model changes

None?

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany SerkanB

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024