Module: check_mk
Branch: master
Commit: 1c5aff2aab571fb1c609411ae3f1f0a6633b1d94
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c5aff2aab571f…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Sep 18 14:02:45 2017 +0200
5288 FIX BI packs: Fixed permission of target pack for bulk moving operation of rules
Change-Id: Ia6bd790b9acd85d5180a7e411167337839551967
---
.werks/5288 | 10 ++++++++++
web/plugins/wato/bi.py | 11 ++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/5288 b/.werks/5288
new file mode 100644
index 0000000..23ad300
--- /dev/null
+++ b/.werks/5288
@@ -0,0 +1,10 @@
+Title: BI packs: Fixed permission of target pack for bulk moving operation of rules
+Level: 1
+Component: bi
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1505736108
+Class: fix
+
+
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index e2e046b..34dec4b 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -414,9 +414,13 @@ class ModeBI(WatoMode):
return False
- def must_be_contact_for_pack(self):
- if not self.is_contact_for_pack():
- raise MKAuthException(_("You have no permission for changes in this BI
pack."))
+ def must_be_contact_for_pack(self, pack=None):
+ if not self.is_contact_for_pack(pack=pack):
+ if pack is None:
+ pack_title = self._pack["title"]
+ else:
+ pack_title = pack["title"]
+ raise MKAuthException(_("You have no permission for changes in this BI
pack %s.") % pack_title)
def _validate_rule_call(self, value, varprefix):
@@ -1177,6 +1181,7 @@ class ModeBIRules(ModeBI):
target_pack = None
if target in self._packs:
target_pack = self._packs[target]
+ self.must_be_contact_for_pack(target_pack)
selected_rules = self._get_selected_rules()
if selected_rules and target_pack is not None: