Refs #729 - Hide updates from system report widget when permissions [system.manage_updates] are denied
This commit is contained in:
parent
5e3ee40edf
commit
e82198b8ad
|
|
@ -44,6 +44,7 @@ class Status extends ReportWidgetBase
|
|||
protected function loadData()
|
||||
{
|
||||
$manager = UpdateManager::instance();
|
||||
$this->vars['showUpdates'] = $this->controller->user->hasAccess('system.manage_updates');
|
||||
$this->vars['updates'] = $manager->check();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@
|
|||
<span class="status circle success"></span>
|
||||
<?= e(trans('backend::lang.dashboard.status.online')) ?>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= Backend::url('system/updates') ?>">
|
||||
<span class="status primary"><?= $updates ?></span>
|
||||
<?= e(trans_choice('backend::lang.dashboard.status.update_available', $updates)) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($showUpdates): ?>
|
||||
<li>
|
||||
<a href="<?= Backend::url('system/updates') ?>">
|
||||
<span class="status primary"><?= $updates ?></span>
|
||||
<?= e(trans_choice('backend::lang.dashboard.status.update_available', $updates)) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="flash-message static warning"><?= e($error) ?></p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue