Module: check_mk
Branch: master
Commit: 48458a35cfa1eae6554d0ec918d7b90e34312e4c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=48458a35cfa1ea…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 21 16:50:15 2012 +0100
WATO: honor permissions on inventory
---
.bugs/622 | 7 +++++--
ChangeLog | 1 +
web/htdocs/wato.py | 8 ++++++++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.bugs/622 b/.bugs/622
index b0dbafe..314c1c2 100644
--- a/.bugs/622
+++ b/.bugs/622
@@ -1,9 +1,12 @@
Title: Inventory prüft die Rechte nicht ordentlich
Component: wato
-State: open
+Class: bug
+State: done
Date: 2012-01-18 10:31:24
Targetversion: 1.2.0
-Class: bug
Ich kann sowohl via Bulk Inventory, als auch über das normale Inventory das Inventory
eines
Hosts anstoßen, auch wenn ich keine Rechte habe.
+
+2012-02-21 16:50:01: changed state open -> done
+Das sollte jetzt beides funktionieren.
diff --git a/ChangeLog b/ChangeLog
index 72dd885..08d36ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* FIX: honor write permissions on folder in "bulk delete"
* FIX: honor permissions for "bulk cleanup" and "bulk edit"
* FIX: honor write permissions and source folder when moving hosts
+ * FIX: honor permissions on hosts also on bulk inventory
Checks & Agents:
* hpux_if: fix missing default parameter errors
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 951ccbb..b50e56e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1915,6 +1915,7 @@ def mode_inventory(phase, firsttime):
elif phase == "action":
config.need_permission("wato.services")
+ check_host_permissions(hostname)
if html.check_transaction():
cache_options = not html.var("_scan") and [ '--cache' ] or
[]
table = check_mk_automation(host[".siteid"],
"try-inventory", cache_options + [hostname])
@@ -2347,7 +2348,14 @@ def mode_bulk_inventory(phase):
# interactive progress is *not* done in action phase. It
# renders the page content itself.
+
hostnames = get_hostnames_from_checkboxes()
+
+ # check all permissions before beginning inventory
+ config.need_permission("wato.services")
+ for hostname in hostnames:
+ check_host_permissions(hostname)
+
items = [ "%s|%s" % (g_folder[".path"], hostname)
for hostname in hostnames ]