craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
215 stars 169 forks source link

[5.x]: User need to be an admin to see the store on widget form in the single site setup #3428

Closed vnali closed 4 months ago

vnali commented 4 months ago

What happened?

Hi. On the single site setup, the user need to be an admin to see store in widget forms.

In this line, The logic of code is to check if an user has access to editSite:[sites related to the store], and for a single site setup user only must be an admin to pass this permission, which is not ideal. -because there is no editSite:[primarySite] permission in the permission lists for a single site setup.

Maybe a fix is to check for (Craft::$app->getIsMultiSite()) before that line but i am wondering if it means we give the user access to that one store as default? although in this special case user must can manage orders to use that widget.

widget - Copy

Craft CMS version

5.0.0-beta.7

Craft Commerce version

5.0.0-beta.1

PHP version

8.2

Operating system and version

No response

Database type and version

MariaDB 10.6.7

Image driver and version

No response

Installed plugins and versions

-

linear[bot] commented 4 months ago

PT-1309 [5.x]: User need to be an admin to see the store on widget form in the single site setup

nfourtythree commented 4 months ago

@vnali Thank you for bringing this to our attention.

We have pushed a fix which will be included in the next release of the Commerce beta.

To get this early, change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "5.0.x-dev#b2ff955bc547b906cfb18eb024c3bafc523a3d8e as 5.0.0-beta.1",
  "...": "..."
}

Then run composer update.

Thanks!