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
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
Comment #2
bradjones1Comment #3
mhawwari commentedI 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.
Comment #4
rszrama commented+1 from me, too. Thanks, guys!
Comment #5
tcrawford commentedComment #7
tcrawford commentedComment #8
tcrawford commentedI 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.
Comment #9
tcrawford commentedReassigning the ticket to myself to fix the failing tests.
Comment #10
tcrawford commentedComment #11
tcrawford commentedI have added test coverage. Thanks in advance for a code review and community testing.
Comment #12
tcrawford commentedI am looking at a cleaner way to implement this, so re-assigning the issue to me.
Comment #13
tcrawford commented