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 000000000000..69358bca69ed --- /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 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) { + return $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 9075bc3b1c2c..6c5302cae4ef 100644 --- a/vendor/magento/module-admin-gws/etc/adminhtml/di.xml +++ b/vendor/magento/module-admin-gws/etc/adminhtml/di.xml @@ -113,6 +113,9 @@ + + +