diff --git a/vendor/magento/module-admin-gws/Plugin/ConfigurableProduct/Block/Adminhtml/Product/Steps/SelectAttributes.php b/vendor/magento/module-admin-gws/Plugin/ConfigurableProduct/Block/Adminhtml/Product/Steps/SelectAttributes.php new file mode 100644 index 000000000000..11bd8c3934db --- /dev/null +++ b/vendor/magento/module-admin-gws/Plugin/ConfigurableProduct/Block/Adminhtml/Product/Steps/SelectAttributes.php @@ -0,0 +1,61 @@ +role = $role; + } + + /** + * Around plugin to determine if admin is allowed to create new product attribute. + * + * @param SelectAttributesBlock $subject + * @param \Closure $proceed + * @param string $dataProvider + * @return string + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundGetAddNewAttributeButton( + SelectAttributesBlock $subject, + \Closure $proceed, + $dataProvider = '' + ): string { + if (!$this->role->getIsAll()) { + return ''; + } + return $proceed($dataProvider); + } +} diff --git a/vendor/magento/module-admin-gws/etc/adminhtml/di.xml b/vendor/magento/module-admin-gws/etc/adminhtml/di.xml index 9075bc3b1c2c..bcf4f9b6373d 100644 --- a/vendor/magento/module-admin-gws/etc/adminhtml/di.xml +++ b/vendor/magento/module-admin-gws/etc/adminhtml/di.xml @@ -122,4 +122,7 @@ + + +