I granted a permission from a module to some roles, then uninstalled the module.
The roles still show this permission (in the config table, and in exported config files). I tried re-saving the admin permissions form, but they are still there.
I granted a permission from a module to some roles, then uninstalled the module.
The roles still show this permission (in the config table, and in exported config files). I tried re-saving the admin permissions form, but they are still there.
Comments
Comment #2
ebeyrent commentedDid you try implementing hook_uninstall() in your module to clean out those permission grants?
Comment #3
joachim commentedThis wasn't my module, it was a contrib module I installed.
And I would expect cleaning out permissions to be something core handles, otherwise nearly every single contrib module would be repeating the same code.
Comment #4
ebeyrent commentedUsually, contrib modules that perform tasks during installation, such as granting permissions to roles, implement a hook_uninstall() to clean up things that were done. Core does not track which changes were made by which module, which is why the hook_uninstall() exists in the first place.
You might want to create an issue on the contributed module's issue queue and request that the module implement that hook and do some cleanup on uninstall.
Comment #5
joachim commented> such as granting permissions to roles,
No, this wasn't the case.
I installed a module. I granted some permissions from that module. I exported my config.
I then uninstalled the module. I exported my config.
The permission strings were still in config, even though they no longer mean anything.
Uninstalling a module means removing all of its data -- that should include permissions from that module which have been granted to roles.
Comment #7
dpi