Closed (fixed)
Project:
Features Roles Permissions
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
2 Mar 2015 at 14:37 UTC
Updated:
5 Jul 2016 at 18:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bkonetzny commentedI try to take a look at this. I thinks thats because anonymous and authenticated user are not real Drupal roles.
Comment #2
alan-ps commentedI faced with the same issue. So, the problem in function _user_features_get_roles (hook_features_export_options()). We should replace parameter to TRUE for include these roles.
Patch attached.
Comment #4
bkonetzny commentedPatch committed to 7.x-1.x, will create a new 7.x-1.2 release based on this.
Comment #5
bkonetzny commentedComment #6
bmunslow commentedHi,
I'm sorry to reopen this issue, but the proposed patch doesn't fix the problem at all.
The reason why is that the module relies heavily on the function
user_role_load_by_name.This function returns an empty result when invoked with 'anonymous user' or 'authenticated user' parameter, since these are not actual roles and thus no components are exported at all.
I propose a complete solution which uses the functions
_user_features_get_rolesanduser_rolesin order to properly export permissions for all roles, including anonymous and authenticated users.Please find attached patch and let me know what you think.
By the way, I have noticed that the function
_user_features_get_rolescan't be relied upon inhook_features_rebuildbecausefeatures_get_default('roles_permissions', $module)returns a translated set of role names and thus a mismatch between role name may occur.I have tested this patch in development and live sites with success so far.
Comment #7
aprohl5 commentedIt appears that the proposed patch has already been added to 7.x-1.2 so I'm marking this closed.