magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Backend: Customer grid not filtered accordingly to admin scope #39190

Open FloForMagento opened 5 hours ago

FloForMagento commented 5 hours ago

Preconditions and environment

Steps to reproduce

  1. In customer grid, with no filter set, have at least two customers on different websites in results.
  2. In System, User Roles, create a new role. In Role ressources, change Role Scopes from All to custom, select only one website.
  3. Affect this role to an admin user, log in with that admin user.
  4. Go in Customers, all customers

Expected result

Grid should show customers accordingly to admin user scope.

Actual result

Magento throw an exception: "More permissions are needed to view this item."

Additional information

The problem is that Magento don't use admin user scope to filter request on customer_grid_flat. It does control scope after that, in Magento\AdminGws\Model\Model::customerLoadAfter, call to hasStoreAccess return false and lead to the exception.

Release note

No response

Triage and priority

m2-assistant[bot] commented 5 hours ago

Hi @FloForMagento. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue: