Fixed multiple permissions on same role, and with shared root permissions #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had following issue:
Permission A which is a parent permission.
Two children permissions B and C that inherit from A.
I have 2 roles, one that has permission B and one that has permission C.
But I also have a superadmin role that has automatically all the permissions, so it has permission A, B and C. I expected it would have all the permissions of B and C, but in fact it only had the permissions from either B or C, depending which one was inserted last in the database.
I changed the code, so if for example B has permission ['edit' => true] and C has permission ['edit' => false], the superadmin will have permission ['edit' => true], no matter which one of B and C was inserted last in the database.
assumption of the library:
slugs are a list of key-values where the value is always a boolean.