Skip to content

Commit

Permalink
Merge pull request #9061 from magento-cia/cia-2.4.8-beta1-develop-bug…
Browse files Browse the repository at this point in the history
…fix-07032024

Cia 2.4.8 beta1 develop bugfix 07032024
  • Loading branch information
pawan-adobe-security authored Jul 4, 2024
2 parents 9ae6c5d + ff97b7e commit 022e64b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TaxImportExport\Controller\Adminhtml;

/**
Expand All @@ -15,7 +18,7 @@ abstract class Rate extends \Magento\Backend\App\Action
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Tax::manage_tax';
public const ADMIN_RESOURCE = 'Magento_TaxImportExport::import_export';

/**
* @var \Magento\Framework\App\Response\Http\FileFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TaxImportExport\Controller\Adminhtml\Rate;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\ResponseInterface;
use Magento\TaxImportExport\Controller\Adminhtml\Rate;

class ExportPost extends \Magento\TaxImportExport\Controller\Adminhtml\Rate
class ExportPost extends Rate implements HttpPostActionInterface
{
/**
* Export action from import/export tax
Expand Down Expand Up @@ -86,16 +91,4 @@ public function execute()

return $this->fileFactory->create('tax_rates.csv', $fileContent, DirectoryList::VAR_DIR);
}

/**
* @return bool
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed(
'Magento_Tax::manage_tax'
) || $this->_authorization->isAllowed(
'Magento_TaxImportExport::import_export'
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TaxImportExport\Controller\Adminhtml\Rate;

use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\TaxImportExport\Controller\Adminhtml\Rate;

class ImportPost extends \Magento\TaxImportExport\Controller\Adminhtml\Rate
class ImportPost extends Rate implements HttpPostActionInterface
{
/**
* import action from import/export tax
* Import action from import/export tax
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
Expand Down Expand Up @@ -39,16 +44,4 @@ public function execute()
$resultRedirect->setUrl($this->_redirect->getRedirectUrl());
return $resultRedirect;
}

/**
* @return bool
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed(
'Magento_Tax::manage_tax'
) || $this->_authorization->isAllowed(
'Magento_TaxImportExport::import_export'
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="content">
<block class="Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport" name="tax-rate-importExport" template="Magento_TaxImportExport::importExport.phtml"/>
<block class="Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport" name="tax-rate-importExport"
template="Magento_TaxImportExport::importExport.phtml" aclResource="Magento_TaxImportExport::import_export"/>
</referenceBlock>
</body>
</page>

0 comments on commit 022e64b

Please sign in to comment.