Skip to content

Commit 936c7de

Browse files
committed
MAGETWO-86935: [Backport] Restricted User Role gets "Something went wrong" when viewing orders - 2.1.x
1 parent 6db65b0 commit 936c7de

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function execute()
3232
$aclResource = $component->getData('acl');
3333

3434
if ($aclResource && !$this->_authorization->isAllowed($aclResource)) {
35-
$this->_redirect('admin/noroute');
35+
if (!$this->_request->isAjax()) {
36+
$this->_redirect('admin/noroute');
37+
}
38+
3639
return;
3740
}
3841

app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ public function testExecuteAjaxRequestWithoutPermissions($acl, $isAllowed)
149149
->method('getParam')
150150
->with('namespace')
151151
->willReturn($name);
152+
153+
if ($isAllowed === false) {
154+
$this->requestMock->expects($this->once())
155+
->method('isAjax')
156+
->willReturn(true);
157+
}
158+
159+
$this->responseMock->expects($this->never())
160+
->method('setRedirect');
152161
$this->responseMock->expects($this->any())
153162
->method('appendBody')
154163
->with($renderedData);

0 commit comments

Comments
 (0)