-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add permission for enableLink #135
Conversation
configuration.php
Outdated
@@ -6,6 +6,7 @@ | |||
$this->providePermission('grafana/graphconfig', $this->translate('Allow to configure graphs.')); | |||
$this->providePermission('grafana/debug', $this->translate('Allow to see module debug informations.')); | |||
$this->providePermission('grafana/showall', $this->translate('Allow access to see all graphs of a host.')); | |||
$this->providePermission('grafana/enableLink', $this->translate('Enable link to grafana')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I‘d suggest to keep permissions lowercase.
I would also do that for the config setting, but that‘s for a different issue.
@@ -511,7 +511,7 @@ public function getPreviewHtml(MonitoredObject $object, $report = false) | |||
$res = $this->getMyPreviewHtml($serviceName, $hostName, $previewHtml); | |||
|
|||
//do not render URLs on error or if disabled | |||
if (!$res || $this->enableLink == "no") { | |||
if (!$res || $this->enableLink == "no" || !$this->permission->hasPermission('grafana/enableLink')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that condition really correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yepp its correct.
Please lowercase the permissions as @dnsmichi suggested and i will add it. |
ok, the permission name ist now enable-link. |
please add a permission to enable the link just for some roles