Skip to content

Commit

Permalink
Backport to V3: Add user permission to control access for testGrafana…
Browse files Browse the repository at this point in the history
…Connection method
  • Loading branch information
nook24 committed Feb 26, 2020
1 parent 581cc90 commit 50722be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Plugin/GrafanaModule/Config/acl_dependencies.php
Expand Up @@ -40,7 +40,7 @@
],
'dependencies' => [
'GrafanaConfiguration' => [
'index' => ['testGrafanaConnection', 'loadHostgroups'],
'index' => ['loadHostgroups'],
],
'GrafanaUserdashboards' => [
'add' => ['loadContainers'],
Expand Down
12 changes: 7 additions & 5 deletions app/Plugin/GrafanaModule/View/GrafanaConfiguration/index.ctp
Expand Up @@ -188,11 +188,13 @@
<div class="col-xs-12 margin-top-10">
<div class="well formactions ">
<div class="pull-right">
<button type="button"
class="btn text-center btn-primary"
ng-click="checkGrafanaConnection()">
<?php echo __('Check Grafana Connection'); ?>
</button>
<?php if ($this->Acl->hasPermission('testGrafanaConnection', 'GrafanaConfiguration', 'GrafanaModule')): ?>
<button type="button"
class="btn text-center btn-primary"
ng-click="checkGrafanaConnection()">
<?php echo __('Check Grafana Connection'); ?>
</button>
<?php endif; ?>
<input class="btn btn-primary" type="submit" value="Save">&nbsp;
</div>
</div>
Expand Down

0 comments on commit 50722be

Please sign in to comment.