Skip to content

Commit 022e64b

Browse files
Merge pull request #9061 from magento-cia/cia-2.4.8-beta1-develop-bugfix-07032024
Cia 2.4.8 beta1 develop bugfix 07032024
2 parents 9ae6c5d + ff97b7e commit 022e64b

File tree

4 files changed

+19
-29
lines changed

4 files changed

+19
-29
lines changed

app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace 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

app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ExportPost.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\TaxImportExport\Controller\Adminhtml\Rate;
710

11+
use Magento\Framework\App\Action\HttpPostActionInterface;
812
use Magento\Framework\App\Filesystem\DirectoryList;
913
use 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
}

app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ImportPost.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\TaxImportExport\Controller\Adminhtml\Rate;
710

811
use 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
}

app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
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>

0 commit comments

Comments
 (0)