Skip to content

Restrict product XLSX import to the global admin scope - #889

Merged
KrzysztofPajak merged 2 commits into
developfrom
fix/product-import-tenant-scope
Oct 11, 2026
Merged

KrzysztofPajak merged 2 commits into
developfrom
fix/product-import-tenant-scope

Conversation

@KrzysztofPajak

@KrzysztofPajak KrzysztofPajak commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Type: bugfix

Issue

The product XLSX import in BaseProductController was not limited to the global admin scope, unlike the brand, category and collection imports.

Solution

ImportExcel now rejects the import when the product data scope is store or vendor scoped. The user gets the access-denied message and is redirected to the list. The import manager is not called. This is the same rule the brand, category and collection imports follow.

Breaking changes

None. The main admin panel imports as before. The Store and Vendor panels do not offer product import in their UI.

Testing

  1. dotnet test src/Tests/Grand.Web.Admin.Tests --filter "FullyQualifiedName~BaseProductControllerTests". The new ImportExcel_StoreScope_* and ImportExcel_VendorScope_* tests pass, and so do the existing import tests.
  2. Admin → Catalog → Products → Import still imports an exported products file.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrzysztofPajak
KrzysztofPajak force-pushed the fix/product-import-tenant-scope branch 2 times, most recently from 271afb2 to 4b925a4 Compare October 10, 2026 08:16
Matches the rule brands, categories and collections already follow.
@KrzysztofPajak
KrzysztofPajak force-pushed the fix/product-import-tenant-scope branch from 4b925a4 to f7d2353 Compare October 10, 2026 08:17
@KrzysztofPajak KrzysztofPajak changed the title Deny product XLSX import outside the global admin scope Restrict product XLSX import to the global admin scope Oct 10, 2026
@KrzysztofPajak
KrzysztofPajak merged commit fb3f0f0 into develop Oct 11, 2026
6 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/product-import-tenant-scope branch October 11, 2026 04:39
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.

2 participants