Skip to content

Commit ea600d6

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-86935' into 2.1-develop-pr54
2 parents 08ec01b + 936c7de commit ea600d6

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)