Skip to content

Commit

Permalink
MAGETWO-83270: 11700: "Something Went Wrong" error for limited access…
Browse files Browse the repository at this point in the history
… admin user #11993
  • Loading branch information
ishakhsuvarov authored Nov 7, 2017
2 parents c9f38fa + 4904b3d commit 61a9a5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ private function validateAclResource($dataProviderConfigData)
{
if (isset($dataProviderConfigData['aclResource'])) {
if (!$this->_authorization->isAllowed($dataProviderConfigData['aclResource'])) {
$this->_redirect('admin/denied');
if (!$this->_request->isAjax()) {
$this->_redirect('admin/denied');
}

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ public function testExecuteAjaxRequestWithoutPermissions(array $dataProviderConf
$this->requestMock->expects($this->any())
->method('getParams')
->willReturn([]);
if ($isAllowed === false) {
$this->requestMock->expects($this->once())
->method('isAjax')
->willReturn(true);
}
$this->responseMock->expects($this->never())
->method('setRedirect');
$this->responseMock->expects($this->any())
->method('appendBody')
->with($renderedData);
Expand Down

0 comments on commit 61a9a5e

Please sign in to comment.