cms
cms copied to clipboard
[4.x]: Revoking permissions from user group via project config does not work if all permissions in group is revoked
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
Hi, thanks for reaching out. I’m having trouble replicating it on a fresh Craft 4 install.
When applying your changes, did you try using the --force
flag (php craft project-config/apply --force
) or “Reapply everything” if you’re applying via the Control Panel? Is the outcome still the same - permissions for the user group not getting updated?
Hey there, applying this with craft project-config/apply --force
does work. But I'd still mark this as a bug, as it will not apply the correct project config without forcing it, although it was changed.
+1 this because i ran into the same problem today using craft 4.4.16
PHP version | 8.1.22 MySQL 43 Craft Pro 4.4.16.1 yii version 2.0.47
project-config/apply --force did the trick but obviously I do not want to do this each time i want to disable a usergroups permissions to access a specific section.
Thanks all!
When it happens again, could you please send composer.json
, composer.lock
, and database export from the environment you’re applying project config changes to (before attempting to apply them) and the project/config
folder with the changes you’re trying to apply to [email protected]?