Skip to content

Admit a sales manager to the admin panel only with a sales employee (2.4.x) - #1081

Merged
KrzysztofPajak merged 1 commit into
2.4.xfrom
fix/sales-manager-admin-access-2.4.x
Nov 22, 2026
Merged

KrzysztofPajak merged 1 commit into
2.4.xfrom
fix/sales-manager-admin-access-2.4.x

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

A sales manager works on the customers and orders of their own sales employee. The admin panel now admits a sales manager only when a sales employee is assigned to their account, the same way it already turns away vendors and store managers.

The customer edit screen already requires a sales employee for the Sales manager group, so accounts created there are unaffected. The rule covers accounts set up any other way.

Changes

  • AuthorizeAdminAttribute: a sales manager without a sales employee is sent to the admin login, like a vendor or a store manager.

Tests

  • AuthorizeAdminAttributeTests (new): staff are admitted, a sales manager with a sales employee is admitted, a sales manager without one is sent to the login, a customer without the panel permission is sent to the login.
  • Grand.Web.Common.Tests (156) and Grand.Web.Admin.Tests (1571) pass.

Backport of #1080 to 2.4.x. The filter here takes IPermissionService, so the test mocks that instead of IRequestPermissionService.

@KrzysztofPajak
KrzysztofPajak merged commit ebc7915 into 2.4.x Nov 22, 2026
3 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/sales-manager-admin-access-2.4.x branch November 22, 2026 10:47
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