Skip to content

Commit 766dd8b

Browse files
authored
add permission check for "reload data" data button
despite that the user does not have permission for refreshing the statistics button, it is shown and when pressed a "not permitted" page is shown. therefore add the check that is used with that controller action.
1 parent 92c4421 commit 766dd8b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Backend/view/adminhtml/templates/dashboard/totalbar/refreshstatistics.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
/** @var \Magento\Backend\Block\Template $block */
23
/**
34
* Copyright © Magento, Inc. All rights reserved.
45
* See COPYING.txt for license details.
@@ -9,6 +10,7 @@
910
<div class="page-actions-buttons">
1011
<?= $block->getChildHtml() ?>
1112

13+
<?php if ($block->getAuthorization()->isAllowed('Magento_Reports::statistics')): ?>
1214
<form class="action-element"
1315
action="<?= $block->escapeUrl($block->getUrl('*/*/refreshStatistics')) ?>"
1416
method="post">
@@ -23,6 +25,7 @@
2325
<?= $block->escapeHtml(__('Reload Data')) ?>
2426
</button>
2527
</form>
28+
<?php endif; ?>
2629
</div>
2730
</div>
2831
</div>

0 commit comments

Comments
 (0)