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

joachim created an issue. See original summary.

ebeyrent’s picture

Did you try implementing hook_uninstall() in your module to clean out those permission grants?

joachim’s picture

This 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.

ebeyrent’s picture

Usually, 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.

joachim’s picture

> 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.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture