Skip to content

Commit b93d40d

Browse files
ihorvansachnaydav
authored andcommitted
[Login As Customer] Replaced _isAllowed with ADMIN_RESOURCE in adminhtml controllers
1 parent e65974e commit b93d40d

File tree

4 files changed

+20
-40
lines changed

4 files changed

+20
-40
lines changed

app/code/Magento/LoginAsCustomer/Controller/Adminhtml/Login/Grid.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
*/
1212
class Grid extends \Magento\Backend\App\Action
1313
{
14+
/**
15+
* Authorization level of a basic admin session
16+
*/
17+
const ADMIN_RESOURCE = 'Magento_LoginAsCustomer::login_log';
18+
1419
/**
1520
* Login as customer log grid
1621
*
@@ -21,14 +26,4 @@ public function execute()
2126
$this->_view->loadLayout(false);
2227
$this->_view->renderLayout();
2328
}
24-
25-
/**
26-
* Check is allowed access
27-
*
28-
* @return bool
29-
*/
30-
protected function _isAllowed()
31-
{
32-
return $this->_authorization->isAllowed('Magento_LoginAsCustomer::login_log');
33-
}
3429
}

app/code/Magento/LoginAsCustomer/Controller/Adminhtml/Login/Index.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
*/
1212
class Index extends \Magento\Backend\App\Action
1313
{
14+
/**
15+
* Authorization level of a basic admin session
16+
*/
17+
const ADMIN_RESOURCE = 'Magento_LoginAsCustomer::login_log';
18+
1419
/**
1520
* @var \Magento\LoginAsCustomer\Model\Login
1621
*/
@@ -49,14 +54,4 @@ public function execute()
4954
$this->_addBreadcrumb($title, $title);
5055
$this->_view->renderLayout();
5156
}
52-
53-
/**
54-
* Check is allowed access
55-
*
56-
* @return bool
57-
*/
58-
protected function _isAllowed()
59-
{
60-
return $this->_authorization->isAllowed('Magento_LoginAsCustomer::login_log');
61-
}
6257
}

app/code/Magento/LoginAsCustomer/Controller/Adminhtml/Login/Login.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*/
1313
class Login extends \Magento\Backend\App\Action
1414
{
15+
/**
16+
* Authorization level of a basic admin session
17+
*/
18+
const ADMIN_RESOURCE = 'Magento_LoginAsCustomer::login_button';
19+
1520
/**
1621
* @var \Magento\LoginAsCustomer\Model\Login
1722
*/
@@ -114,14 +119,4 @@ public function execute()
114119

115120
$this->getResponse()->setRedirect($redirectUrl);
116121
}
117-
118-
/**
119-
* Check is allowed access
120-
*
121-
* @return bool
122-
*/
123-
protected function _isAllowed()
124-
{
125-
return $this->_authorization->isAllowed('Magento_LoginAsCustomer::login_button');
126-
}
127122
}

app/code/Magento/LoginAsCustomer/Controller/Adminhtml/Login/Manual.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*/
1313
class Manual extends \Magento\Backend\App\Action
1414
{
15+
/**
16+
* Authorization level of a basic admin session
17+
*/
18+
const ADMIN_RESOURCE = 'Magento_LoginAsCustomer::login_button';
19+
1520
/**
1621
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
1722
*/
@@ -24,14 +29,4 @@ public function execute()
2429
$this->_addBreadcrumb($title, $title);
2530
$this->_view->renderLayout();
2631
}
27-
28-
/**
29-
* Check is allowed access
30-
*
31-
* @return bool
32-
*/
33-
protected function _isAllowed()
34-
{
35-
return $this->_authorization->isAllowed('Magento_LoginAsCustomer::login_button');
36-
}
3732
}

0 commit comments

Comments
 (0)