File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app/code/Magento/Ui/Controller/Adminhtml/Index Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,18 @@ public function execute()
8686
8787 $ contentType = $ this ->contentTypeResolver ->resolve ($ component ->getContext ());
8888 $ this ->getResponse ()->setHeader ('Content-Type ' , $ contentType , true );
89+ }else {
90+ /** @var \Magento\Framework\Controller\Result\Json $resultJson */
91+ $ resultJson = $ this ->resultJsonFactory ->create ();
92+ $ resultJson ->setStatusHeader (
93+ \Zend \Http \Response::STATUS_CODE_403 ,
94+ \Zend \Http \AbstractMessage::VERSION_11 ,
95+ 'Forbidden '
96+ );
97+ return $ resultJson ->setData ([
98+ 'error ' => $ this ->escaper ->escapeHtml ('Forbidden ' ),
99+ 'errorcode ' => 403 ]
100+ );
89101 }
90102 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
91103 $ this ->logger ->critical ($ e );
You can’t perform that action at this time.
0 commit comments