Problem/Motivation
The promotion reorder page (/admin/commerce/promotions/reorder) is accessible with the access commerce_promotion overview permission, and lists the promotions the user can view. However, PromotionListBuilder::submitForm() saves the new weight of every listed promotion without checking update access.
As a result, a user who can view promotions but not edit them can still change their order, which affects which promotion applies when non-combinable promotions overlap. This is inconsistent with getDefaultOperations(), which already checks update access before showing the edit links.
Proposed resolution
Check update access per promotion on the reorder form:
- Disable the weight field (and the drag handle) for promotions the user cannot update.
- Hide the Save button when the user cannot update any of the listed promotions.
- Skip promotions the user cannot update in
submitForm().
Remaining tasks
- Review the MR.
User interface changes
Users without update access to a promotion can no longer change its weight from the reorder page.
API changes
None.
Issue fork commerce-3641211
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 #6
jsacksick commented