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)
127
127
{
128
128
if (isset ($ dataProviderConfigData ['aclResource ' ])) {
129
129
if (!$ this ->_authorization ->isAllowed ($ dataProviderConfigData ['aclResource ' ])) {
130
- $ this ->_redirect ('admin/denied ' );
130
+ if (!$ this ->_request ->isAjax ()) {
131
+ $ this ->_redirect ('admin/denied ' );
132
+ }
133
+
131
134
return false ;
132
135
}
133
136
}
Original file line number Diff line number Diff line change @@ -279,6 +279,13 @@ public function testExecuteAjaxRequestWithoutPermissions(array $dataProviderConf
279
279
$ this ->requestMock ->expects ($ this ->any ())
280
280
->method ('getParams ' )
281
281
->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 ' );
282
289
$ this ->responseMock ->expects ($ this ->any ())
283
290
->method ('appendBody ' )
284
291
->with ($ renderedData );
You can’t perform that action at this time.
0 commit comments