Skip to content

Commit 96565f2

Browse files
author
Dale Sikkema
committed
Merge branch 'MAGETWO-36837-authentication-bypass' into develop
2 parents 5441128 + 43d044d commit 96565f2

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,10 @@ abstract class AbstractAction extends \Magento\Framework\App\Action\Action
8181
*/
8282
protected $_formKeyValidator;
8383

84-
/**
85-
* Resource used to authorize access to the controller
86-
*
87-
* @var string
88-
*/
89-
protected $resource;
90-
9184
/**
9285
* @param \Magento\Backend\App\Action\Context $context
9386
*/
94-
public function __construct(Action\Context $context, $resource = '')
87+
public function __construct(Action\Context $context)
9588
{
9689
parent::__construct($context);
9790
$this->_authorization = $context->getAuthorization();
@@ -109,7 +102,7 @@ public function __construct(Action\Context $context, $resource = '')
109102
*/
110103
protected function _isAllowed()
111104
{
112-
return $this->_authorization->isAllowed($this->resource ?: self::ADMIN_RESOURCE);
105+
return $this->_authorization->isAllowed(self::ADMIN_RESOURCE);
113106
}
114107

115108
/**

app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testAroundDispatchProlongStorage()
8989
* Calls aroundDispatch to access protected method _processNotLoggedInUser
9090
*
9191
* Data provider supplies different possibilities of request parameters and properties
92-
* @dataProvider userNotLoggedInRequest
92+
* @dataProvider processNotLoggedInUserDataProvider
9393
*/
9494
public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForwardedFlag)
9595
{
@@ -143,14 +143,13 @@ public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForw
143143
$request->expects($this->exactly($setterCalls))->method('setDispatched')->with(false)->willReturnSelf();
144144

145145
$expectedResult = 'expectedResult';
146-
$proceed = function ($request) use ($expectedResult)
147-
{
146+
$proceed = function ($request) use ($expectedResult) {
148147
return $expectedResult;
149148
};
150149
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
151150
}
152151

153-
public function userNotLoggedInRequest()
152+
public function processNotLoggedInUserDataProvider()
154153
{
155154
return [
156155
'iFrame' => [true, false, false],

0 commit comments

Comments
 (0)