diff --git a/vendor/magento/module-admin-gws/Plugin/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentPlugin.php b/vendor/magento/module-admin-gws/Plugin/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentPlugin.php new file mode 100644 index 00000000000..4ea04176d1c --- /dev/null +++ b/vendor/magento/module-admin-gws/Plugin/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/ContentPlugin.php @@ -0,0 +1,49 @@ +role = $role; + } + + /** + * Check if gallery content is editable by checking Admin's exclusive website access. + * + * @param Content $subject + * @param bool $result + * @return bool + */ + public function afterIsEditEnabled( + Content $subject, + bool $result + ): bool { + /** @var ProductInterface $product */ + $product = $subject->getParentBlock()->getDataObject(); + if (!$product) { + $result; + } + + return $this->role->hasExclusiveAccess($product->getWebsiteIds()); + } +} diff --git a/vendor/magento/module-admin-gws/etc/adminhtml/di.xml b/vendor/magento/module-admin-gws/etc/adminhtml/di.xml index 378069507d7..d30d5e5c13f 100644 --- a/vendor/magento/module-admin-gws/etc/adminhtml/di.xml +++ b/vendor/magento/module-admin-gws/etc/adminhtml/di.xml @@ -115,4 +115,7 @@ + + +