When exporting user roles, FeatureManager::addPackageFile() removes the permissions of the exported role:

        // User roles include all permissions currently assigned to them. To
        // avoid extraneous additions, reset permissions.
        if ($config->getType() == 'user_role') {
          $data = $config->getData();
          // Unset and not empty permissions data to prevent loss of configured
          // role permissions in the event of a feature revert.
          unset($data['permissions']);
          $config->setData($data);
        }

Reading the comments, the behaviour seems unintentional. Shouldn't it be possible to export user roles together with the assigned permissions?

How to reproduce:

- assign permissions to a role
- export the role to a feature
- expected behaviour: "permissions: ..." in the yml file, just like the export using config:export
- actual behaviour: permissions are stripped from the yml file

Comments

jsst created an issue. See original summary.

nedjo’s picture

Status: Active » Closed (duplicate)
jsst’s picture

Don't know how I did not see those issues, thanks for the prompt response!

nedjo’s picture

No prob. I've just posted a patch on #2599278: Move export processing to a configurable plugin. Testing and reviews appreciated.