[4.x]: Revoking permissions from user group via project config does not work if all permissions in group is revoked
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
What happened?
Description
When removing permissions from a user group, and pushing project config changes to a different environment, it's not possible to completely remove all permissions in a group of permissions (for instance "Users"). If one or more permissions is set, they are updated correctly.
Steps to reproduce
-
Create a user group with some Users permissions set.

-
Push updated project config to an environment that applies these changes.
-
Change permissions by completely removing all permissions within a permissions group.

-
Push updated project config to an environment that applies these changes.
Expected behavior
The user group should have no permissions to Users.
Actual behavior
The user group have the permissions previously set.
If I keep at least one permission checked in the permissions group, everything works as expected.

Craft CMS version
4.3.10
PHP version
8.1.5
Operating system and version
MacOS 11.2
Database type and version
Mysql 5.7 (local) / 8.0 (prod)
Image driver and version
Imagick 3.7.0
Installed plugins and versions
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the project-config deployment described for Craft CMS 4.3.10, comparing a permissions group with one selected permission against a group with none. Trace the user-group permission update path and verify that the deployed configuration removes previously granted Users permissions; done means the target group has no Users permissions after the second push.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100