Skip to content

fix: restrict the admin order-comments collection to the sale units of a restricted administrator - #19

Merged
anoziere merged 7 commits into
mainfrom
fix/order-comments-sale-unit-scope
Nov 8, 2026
Merged

anoziere merged 7 commits into
mainfrom
fix/order-comments-sale-unit-scope

Conversation

@anoziere

@anoziere anoziere commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

The admin order-comments collection returned the comments of every order to an administrator restricted to some sale units.

  • New query extension OrderComment\Api\Extension\AdminSaleUnitScopeExtension, built on the core AdminSaleUnitScope (thelia/core 3.3.0+): collection and item reads on /admin are bounded by a sub-select on order.sale_unit_id. National accounts and the front collection are unchanged.
  • The resource now declares its admin permission (ORDER) in thelia.api.admin_resources. Without it the admin API refuses every non-super administrator, so a restricted administrator could not read comments at all.
  • Requires thelia/core >= 3.3.0; version 3.1.1; CHANGELOG added.
  • AdminOrderCommentSaleUnitScopeTest fails without the extension (all three comments returned) and passes with it.

@anoziere
anoziere marked this pull request as ready for review November 8, 2026 12:58
@anoziere
anoziere merged commit 4f510f7 into main Nov 8, 2026
8 of 10 checks passed
@anoziere
anoziere deleted the fix/order-comments-sale-unit-scope branch November 8, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant