Module: check_mk
Branch: master
Commit: 940503f7e71e52d9a6387f9ab2a59881fb4b3017
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=940503f7e71e52…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Apr 29 22:52:49 2012 +0200
WATO: parentscan now honors permissions
---
ChangeLog | 1 +
web/htdocs/wato.py | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6cb2349..6d7939f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
retry only hosts that have failed in a previous inventory.
* You can configure parents now (via a host attribute, no rules are
neccessary).
+ * You can now do an automated scan for parents and layer 3 (IP)
* FIX: fix page header after confirmation dialogs
* FIX: Fixed umlaut problem in host aliases and ip addresses created by WATO
* FIX: Fixed exception caused by validation problems during editing tags in WATO
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 80a74da..7d28b1b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2975,6 +2975,8 @@ def configure_gateway(state, site_id, folder, host, effective,
gateway):
gw_folder = g_folder[".folders"]["parents"]
load_hosts(gw_folder)
else:
+ config.need_permission("wato.manage_folders")
+ check_folder_permissions(g_folder, "write")
gw_folder = {
".name" : "parents",
".parent" : g_folder,
@@ -2992,6 +2994,8 @@ def configure_gateway(state, site_id, folder, host, effective,
gateway):
load_hosts(gw_folder)
# Create gateway host
+ config.need_permission("wato.manage_hosts")
+ check_folder_permissions(gw_folder, "write")
if dns_name:
gw_host = dns_name
elif site_id:
@@ -3033,6 +3037,10 @@ def configure_gateway(state, site_id, folder, host, effective,
gateway):
return _("Parents unchanged at %s") % \
(parents and ",".join(parents) or _("none")), False,
gwcreat
+
+ config.need_permission("wato.edit_hosts")
+ check_host_permissions(host[".name"], folder=folder)
+
if force_explicit:
host["parents"] = parents
else: