Skip to content

Commit 082e6a2

Browse files
author
arosliuk
committed
Move ACL resources to const in SuggestedAttributeSets.php and SuggestedAttributes.php
1 parent 15d7ff1 commit 082e6a2

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestAttributeSets.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
class SuggestAttributeSets extends \Magento\Backend\App\Action
1010
{
11+
/**
12+
* Authorization level of a basic admin session
13+
*
14+
* @see _isAllowed()
15+
*/
16+
const ADMIN_RESOURCE = 'Magento_Catalog::sets';
17+
1118
/**
1219
* @var \Magento\Framework\Controller\Result\JsonFactory
1320
*/
@@ -46,15 +53,5 @@ public function execute()
4653
);
4754
return $resultJson;
4855
}
49-
50-
/**
51-
* Check for is allowed
52-
*
53-
* @return boolean
54-
*/
55-
protected function _isAllowed()
56-
{
57-
return $this->_authorization->isAllowed('Magento_Catalog::sets');
58-
}
5956
}
6057

app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestAttributes.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
class SuggestAttributes extends \Magento\Backend\App\Action
1010
{
11+
/**
12+
* Authorization level of a basic admin session
13+
*
14+
* @see _isAllowed()
15+
*/
16+
const ADMIN_RESOURCE = 'Magento_Catalog::attributes_attributes';
17+
1118
/**
1219
* @var \Magento\Framework\Controller\Result\JsonFactory
1320
*/
@@ -20,6 +27,7 @@ class SuggestAttributes extends \Magento\Backend\App\Action
2027

2128
/**
2229
* @param \Magento\Backend\App\Action\Context $context
30+
* @param \Magento\Catalog\Controller\Adminhtml\Product\Builder $productBuilder
2331
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
2432
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
2533
*/
@@ -48,15 +56,5 @@ public function execute()
4856
);
4957
return $resultJson;
5058
}
51-
52-
/**
53-
* Check for is allowed
54-
*
55-
* @return boolean
56-
*/
57-
protected function _isAllowed()
58-
{
59-
return $this->_authorization->isAllowed('Magento_Catalog::attributes_attributes');
60-
}
6159
}
6260

0 commit comments

Comments
 (0)