A bit of a spiritual follow-up to #2904459: Product attributes edit but not create - the ProductAttribute config entity and ProductAttributeValue content entity share a single admin permission, administer commerce_product_attribute. This results in users (e.g., content moderators/editors) making updates to the config entity such as changing an attribute name, which when using a deployment strategy that imports config (e.g., assumes config changes will be made in dev and pushed to production) these changes will be overwritten.

I think it would be sensible to split these permissions (or at least dynamically support such a differentiation) to avoid a WTF condition on the part of developers and non-technical end users.

Issue fork commerce-3126885

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bradjones1 created an issue. See original summary.

bradjones1’s picture

mhawwari’s picture

I find the permissions split also necessary in my case for giving specific roles access to translate the attribute value entities without needing to give them the "Translate configuration" permission.

rszrama’s picture

+1 from me, too. Thanks, guys!

tcrawford’s picture

Assigned: Unassigned » tcrawford

tcrawford’s picture

Assigned: tcrawford » Unassigned
Status: Active » Needs review
tcrawford’s picture

I have added a proposed solution (MR 239) where I have split the permissions and modified the existing ProductAttributeForm. There are certainly places this approach could be improved. I would appreciate a code review. Thanks in advance.

tcrawford’s picture

Assigned: Unassigned » tcrawford
Status: Needs review » Needs work

Reassigning the ticket to myself to fix the failing tests.

tcrawford’s picture

Issue tags: +Barcelona2024
tcrawford’s picture

Assigned: tcrawford » Unassigned
Status: Needs work » Needs review

I have added test coverage. Thanks in advance for a code review and community testing.

tcrawford’s picture

Assigned: Unassigned » tcrawford

I am looking at a cleaner way to implement this, so re-assigning the issue to me.

tcrawford’s picture

Assigned: tcrawford » Unassigned