Module: check_mk
Branch: master
Commit: e00d3fbeb3b15e12ade9c8dd1273e1ca6ae7858e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e00d3fbeb3b15e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue May 16 12:54:31 2017 +0200
Another update to werk #4658
Change-Id: Iaf6ac91e7c17c4bd536ec6e63c61806b1af511da
---
web/plugins/wato/bi.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index 670c4a7..f20c9ef 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -1203,6 +1203,8 @@ class ModeBIRules(ModeBI):
def page(self):
+ self.must_be_contact_for_pack()
+
if not self._pack["aggregations"] and not
self._pack["rules"]:
new_url = self.url_to_pack([("mode", "bi_edit_rule")])
menu_items = [
@@ -1532,6 +1534,8 @@ class ModeBIEditRule(ModeBI):
def page(self):
+ self.must_be_contact_for_pack()
+
if self._new:
cloneid = html.var("clone")
if cloneid:
@@ -1566,13 +1570,15 @@ class ModeBIEditRule(ModeBI):
rules_without_permissions = {}
for node in rulepack.get("nodes", []):
node_type, node_content = node
- node_name = node_content[0]
- pack = self.pack_containing_rule(node_name)
- if node_type == 'call' and pack is not None and \
- not self.may_use_rules_in_pack(pack):
- packid = (pack['id'], pack['title'])
- rules_without_permissions.setdefault(packid, [])
- rules_without_permissions[packid].append(node_name)
+ if node_type != 'call':
+ continue
+
+ node_ruleid = node_content[0]
+ pack = self.pack_containing_rule(node_ruleid)
+ if pack is not None and not self.may_use_rules_in_pack(pack):
+ packid = (pack['id'], pack['title'])
+ rules_without_permissions.setdefault(packid, [])
+ rules_without_permissions[packid].append(node_ruleid)
if rules_without_permissions:
message = ", ".join([_("BI rules %s from BI pack
'%s'") % \