There are permissions to duplicate the product type, but is there permission to duplicate product variations ?

If I am an administrator, I can duplicate the variations. But if I am a user and owner of a store, I cannot certify my variations. Why is there no permission to duplicate the variations ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Issue summary: View changes
zenimagine’s picture

The only way to duplicate variations for a store owner and give him "Administer products" permission, but I can't give him that high a permission.

It would make sense that a store owner could duplicate his variations with the "[Product variations] Manage Product" permission, but that doesn't work.

czigor’s picture

For me granting the "[Product variations] Manage Default" is enough to duplicate product variations. That's the only product permission my user has. Can you check again?

zenimagine’s picture

@czigor Yes this is the first thing I tried but it doesn't work. My store owner on a 403 page if he duplicates a variation.

I have the Commerce Marketplace module installed and I have the impression that it breaks a lot in Commerce since version 2.16

https://www.drupal.org/project/commerce_marketplace

It's really a shame that Commerce doesn't include authorizations for store owners.

czigor’s picture

Commerce Marketplace does change variation access. Compare MarketplaceProductVariationAccessControlHandler::checkAccess() and ProductVariationAccessControlHandler::checkAccess(). So that might be the reason.

Can you check this on a clean Drupal Commerce install?

bojanz’s picture

Status: Active » Fixed

I can confirm that the problem is in Commerce Marketplace.

The access control handler from https://git.drupalcode.org/project/commerce_marketplace/blob/8.x-1.x/src... doesn't extend ProductVariationAccessControlHandler at all, so the "manage" permissions are never used.

Thanks, czigor!

zenimagine’s picture

Thank you I opened a problem in Commerce Marketplace

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.