- Issue created by @koosvdkolk
- πΊπΈUnited States Chris Burge
Is Features configured to export permissions with roles? It sounds like that is the issue.
- π³π±Netherlands koosvdkolk
My mistake.
I enabled the "Strip out user permissions." and now the role ymls do not have the permissions anymore.
So in my Feature, both the roles and (all) permissions are present. The role ymls do not contain permissions, the permission ymls contain roles. So far, so good. Nevertheless, the permissions are not added when I enable the Feature.
What strikes me: If I enable my Feature and perform a 'drush fim' afterwards, it asks me to import the roles defined in the Feature.
Could it be that for some reason, the roles are not imported yet at the moment the permissions get imported and hence, the permission assignment does not take place?
- π³π±Netherlands koosvdkolk
Diving into the code, and I do not understand how this module should work.
* I have enabled features_permissions
* I have a Feature containing the permissions AND the rolesI enable the Feature.
This is what happens: PermissionManager::syncRoleToPermissions is called for each new role in the Feature. Below arrays are all empty.
$added_permissions = array_diff($permissions, $permissions_original)
End result:
* Roles are present
* Permissions are present
* No permissions are added to roles.So indeed my $0.02 would be that features_permissions tries receives the events in the wrong order in my use case: it tries to add yet-to-be-imported Feature permissions to Feature roles.