Problem/Motivation

Users that do not have the "administer field inheritance" permission see the "Enable inheritance for this entity?" option when editing an entity/bundle that is allowed to have field inheritance, allowing any user with edit permission to configure field inheritance. That option should be limited to users whose roles have the "administer field inheritance" permission.

Steps to reproduce

  1. Enable the field inheritance module and configure an entity/bundle to allow field inheritance (we noticed the issue using Recurring Events).
  2. Add a role that does NOT include the "administer field inheritance" permission, but does have permission to create or edit the entity/bundle configured above, and log in as a user with only that role.
  3. Navigate to, and edit, an entity/bundle that has allow field inheritance enabled
  4. Note the presence of the Field Inheritance fieldset with the "Enable inheritance for this entity?" option.

Proposed resolution

Check for the permission in field_inheritance_form_alter and return without altering the form if the user doesn't have the permission.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

greggmarshall created an issue. See original summary.

greggmarshall’s picture

Patch to check permissions during field_inheritance_form_alter

owenbush’s picture

Status: Active » Needs review

Thanks for the patch, I'm marking it as needs review so I can get back to it when I have a working local dev again.

owenbush’s picture

Status: Needs review » Fixed

This looked good to me, thank you for the patch. The only change I made was to move the permission check to the top of the form alter, to stop us having to do any unnecessary lookups if users do not have access.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.