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 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \TaxImportExport \Controller \Adminhtml ;
7
10
8
11
/**
@@ -15,7 +18,7 @@ abstract class Rate extends \Magento\Backend\App\Action
15
18
*
16
19
* @see _isAllowed()
17
20
*/
18
- const ADMIN_RESOURCE = 'Magento_Tax::manage_tax ' ;
21
+ public const ADMIN_RESOURCE = 'Magento_TaxImportExport::import_export ' ;
19
22
20
23
/**
21
24
* @var \Magento\Framework\App\Response\Http\FileFactory
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
7
10
11
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
8
12
use Magento \Framework \App \Filesystem \DirectoryList ;
9
13
use Magento \Framework \App \ResponseInterface ;
14
+ use Magento \TaxImportExport \Controller \Adminhtml \Rate ;
10
15
11
- class ExportPost extends \ Magento \ TaxImportExport \ Controller \ Adminhtml \ Rate
16
+ class ExportPost extends Rate implements HttpPostActionInterface
12
17
{
13
18
/**
14
19
* Export action from import/export tax
@@ -86,16 +91,4 @@ public function execute()
86
91
87
92
return $ this ->fileFactory ->create ('tax_rates.csv ' , $ fileContent , DirectoryList::VAR_DIR );
88
93
}
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
- }
101
94
}
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \TaxImportExport \Controller \Adminhtml \Rate ;
7
10
8
11
use Magento \Framework \Controller \ResultFactory ;
12
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
13
+ use Magento \TaxImportExport \Controller \Adminhtml \Rate ;
9
14
10
- class ImportPost extends \ Magento \ TaxImportExport \ Controller \ Adminhtml \ Rate
15
+ class ImportPost extends Rate implements HttpPostActionInterface
11
16
{
12
17
/**
13
- * import action from import/export tax
18
+ * Import action from import/export tax
14
19
*
15
20
* @return \Magento\Backend\Model\View\Result\Redirect
16
21
*/
@@ -39,16 +44,4 @@ public function execute()
39
44
$ resultRedirect ->setUrl ($ this ->_redirect ->getRedirectUrl ());
40
45
return $ resultRedirect ;
41
46
}
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
- }
54
47
}
Original file line number Diff line number Diff line change 8
8
<page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
9
9
<body >
10
10
<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" />
12
13
</referenceBlock >
13
14
</body >
14
15
</page >
You can’t perform that action at this time.
0 commit comments