File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Controller/Adminhtml/Index
Test/Unit/Controller/Adminhtml/Index Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,10 @@ private function validateAclResource($dataProviderConfigData)
127127 {
128128 if (isset ($ dataProviderConfigData ['aclResource ' ])) {
129129 if (!$ this ->_authorization ->isAllowed ($ dataProviderConfigData ['aclResource ' ])) {
130- $ this ->_redirect ('admin/denied ' );
130+ if (!$ this ->_request ->isAjax ()) {
131+ $ this ->_redirect ('admin/denied ' );
132+ }
133+
131134 return false ;
132135 }
133136 }
Original file line number Diff line number Diff line change @@ -279,6 +279,13 @@ public function testExecuteAjaxRequestWithoutPermissions(array $dataProviderConf
279279 $ this ->requestMock ->expects ($ this ->any ())
280280 ->method ('getParams ' )
281281 ->willReturn ([]);
282+ if ($ isAllowed === false ) {
283+ $ this ->requestMock ->expects ($ this ->once ())
284+ ->method ('isAjax ' )
285+ ->willReturn (true );
286+ }
287+ $ this ->responseMock ->expects ($ this ->never ())
288+ ->method ('setRedirect ' );
282289 $ this ->responseMock ->expects ($ this ->any ())
283290 ->method ('appendBody ' )
284291 ->with ($ renderedData );
You can’t perform that action at this time.
0 commit comments