Module: check_mk
Branch: master
Commit: edafd48f94cc2ab235b18734268b0370beb559dc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=edafd48f94cc2a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Sep 13 10:19:05 2017 +0200
5124 FIX Service discovery: Fixed permission if user is not allowed to manage services
Change-Id: I9cb2a422b7119e60ff839d050ad6560129bd7a4b
---
.werks/5124 | 11 +++++++++++
web/htdocs/wato.py | 11 +++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/5124 b/.werks/5124
new file mode 100644
index 0000000..9996ef4
--- /dev/null
+++ b/.werks/5124
@@ -0,0 +1,11 @@
+Title: Service discovery: Fixed permission if user is not allowed to manage services
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505290711
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 402afe7..c1511d7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3161,7 +3161,7 @@ class ModeDiscovery(WatoMode):
def _show_bulk_checkbox(self, table_source, check_type, item, show_bulk_actions):
- if not self._show_checkboxes:
+ if not self._show_checkboxes or not config.user.may("wato.services"):
return
if not show_bulk_actions:
@@ -3215,10 +3215,17 @@ class ModeDiscovery(WatoMode):
("host", self._host_name), ("item",
mk_repr(descr)), ]),
_("Edit and analyze the disabled services rules"),
"rulesets")
+ table.cell(css="buttons")
+ if not config.user.may("wato.services"):
+ html.empty_icon()
+ html.empty_icon()
+ html.empty_icon()
+ html.empty_icon()
+ return
+
table_source, check_type, checkgroup, item, paramstring, params, \
descr, state, output, perfdata = check
checkbox_name = self._checkbox_name(check_type, item)
- table.cell(css="buttons")
buttons = []
if table_source == self.SERVICE_MONITORED:
buttons.append(icon_button(table_source, checkbox_name,
self.SERVICE_UNDECIDED, "undecided"))