It seems that this module doesn't deploy the settings for registered and anonymous users. Would it be possible to include these roles as well?

Comments

bkonetzny’s picture

Assigned: Unassigned » bkonetzny

I try to take a look at this. I thinks thats because anonymous and authenticated user are not real Drupal roles.

alan-ps’s picture

Status: Active » Needs review
StatusFileSize
new555 bytes

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

  • bkonetzny committed 23e3851 on 7.x-1.x authored by alan-io1
    Issue #2444319 by alan-io1: permissions for registered and anonymous...
bkonetzny’s picture

Status: Needs review » Fixed

Patch committed to 7.x-1.x, will create a new 7.x-1.2 release based on this.

bkonetzny’s picture

Status: Fixed » Closed (fixed)
bmunslow’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.75 KB

Hi,

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_roles and user_roles in 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_roles can't be relied upon in hook_features_rebuild because features_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.

aprohl5’s picture

Version: 7.x-1.1 » 7.x-1.2
Status: Needs review » Closed (fixed)

It appears that the proposed patch has already been added to 7.x-1.2 so I'm marking this closed.