What happened?
Description
I created a Listeners class in the app/Listeners directory with the following function
public function handle(UserPermissionsResolving $event): void
{
$event->permissions = $event->permissions->push(new PermissionGroup(
heading: 'Custom Permissions',
permissions: collect([
new Permission(
key: 'permission 1',
label: 'Permission 1',
nested: collect([
new Permission(
key: 'nestedPermission',
label: 'Nested Permission',
),
])
),
]),
));
}
Those custom permissions do show up in on the user page, but when selecting the permissions and saving the user (or user group) those permissions are not persistent.
It looks like that when the Facade class is getting called (https://github.com/craftcms/cms/blob/6.x/src/Http/Controllers/Users/PermissionsController.php#L213) the event is not getting triggerd which removes the custom permissions
Steps to reproduce
- Add custom permissions
- save user with new permissions
- refresh the user page
- permissions are unset
Expected behavior
Custom permissions are set after saving
Craft CMS version
6.0.0-alpha.11
PHP version
8.5
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
What happened?
Description
I created a Listeners class in the
app/Listenersdirectory with the following functionThose custom permissions do show up in on the user page, but when selecting the permissions and saving the user (or user group) those permissions are not persistent.
It looks like that when the Facade class is getting called (https://github.com/craftcms/cms/blob/6.x/src/Http/Controllers/Users/PermissionsController.php#L213) the event is not getting triggerd which removes the custom permissions
Steps to reproduce
Expected behavior
Custom permissions are set after saving
Craft CMS version
6.0.0-alpha.11
PHP version
8.5
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response