File tree Expand file tree Collapse file tree 4 files changed +19
-29
lines changed
app/code/Magento/TaxImportExport Expand file tree Collapse file tree 4 files changed +19
-29
lines changed Original file line number Diff line number Diff line change 33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \TaxImportExport \Controller \Adminhtml ;
710
811/**
@@ -15,7 +18,7 @@ abstract class Rate extends \Magento\Backend\App\Action
1518 *
1619 * @see _isAllowed()
1720 */
18- const ADMIN_RESOURCE = 'Magento_Tax::manage_tax ' ;
21+ public const ADMIN_RESOURCE = 'Magento_TaxImportExport::import_export ' ;
1922
2023 /**
2124 * @var \Magento\Framework\App\Response\Http\FileFactory
Original file line number Diff line number Diff line change 33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
710
11+ use Magento \Framework \App \Action \HttpPostActionInterface ;
812use Magento \Framework \App \Filesystem \DirectoryList ;
913use Magento \Framework \App \ResponseInterface ;
14+ use Magento \TaxImportExport \Controller \Adminhtml \Rate ;
1015
11- class ExportPost extends \ Magento \ TaxImportExport \ Controller \ Adminhtml \ Rate
16+ class ExportPost extends Rate implements HttpPostActionInterface
1217{
1318 /**
1419 * Export action from import/export tax
@@ -86,16 +91,4 @@ public function execute()
8691
8792 return $ this ->fileFactory ->create ('tax_rates.csv ' , $ fileContent , DirectoryList::VAR_DIR );
8893 }
89-
90- /**
91- * @return bool
92- */
93- protected function _isAllowed ()
94- {
95- return $ this ->_authorization ->isAllowed (
96- 'Magento_Tax::manage_tax '
97- ) || $ this ->_authorization ->isAllowed (
98- 'Magento_TaxImportExport::import_export '
99- );
100- }
10194}
Original file line number Diff line number Diff line change 33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
710
811use Magento \Framework \Controller \ResultFactory ;
12+ use Magento \Framework \App \Action \HttpPostActionInterface ;
13+ use Magento \TaxImportExport \Controller \Adminhtml \Rate ;
914
10- class ImportPost extends \ Magento \ TaxImportExport \ Controller \ Adminhtml \ Rate
15+ class ImportPost extends Rate implements HttpPostActionInterface
1116{
1217 /**
13- * import action from import/export tax
18+ * Import action from import/export tax
1419 *
1520 * @return \Magento\Backend\Model\View\Result\Redirect
1621 */
@@ -39,16 +44,4 @@ public function execute()
3944 $ resultRedirect ->setUrl ($ this ->_redirect ->getRedirectUrl ());
4045 return $ resultRedirect ;
4146 }
42-
43- /**
44- * @return bool
45- */
46- protected function _isAllowed ()
47- {
48- return $ this ->_authorization ->isAllowed (
49- 'Magento_Tax::manage_tax '
50- ) || $ this ->_authorization ->isAllowed (
51- 'Magento_TaxImportExport::import_export '
52- );
53- }
5447}
Original file line number Diff line number Diff line change 88<page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
99 <body >
1010 <referenceBlock name =" content" >
11- <block class =" Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport" name =" tax-rate-importExport" template =" Magento_TaxImportExport::importExport.phtml" />
11+ <block class =" Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport" name =" tax-rate-importExport"
12+ template =" Magento_TaxImportExport::importExport.phtml" aclResource =" Magento_TaxImportExport::import_export" />
1213 </referenceBlock >
1314 </body >
1415</page >
You can’t perform that action at this time.
0 commit comments