Module: check_mk
Branch: master
Commit: 39dbeb2cb2dfd134cd0c5b16a0c848d04a98e472
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=39dbeb2cb2dfd1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 11 10:06:13 2014 +0100
#1496 FIX Fixed exception after editing a dashboard as user without permission to publish
dashboards
When a user without permission to publish a dashboard created or customized a dashboard,
the dashboard could be saved, but resulted in an exception later during rendering the
following pages. This fix prevents creation of damages dashboards.
The exception can be fixed by removing the dashboard definition from
var/check_mk/web/USER/user_dashboards.mk
or simply removing the whole file, which would delete all custom dashboards of the user.
---
.werks/1496 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 3 +++
3 files changed, 19 insertions(+)
diff --git a/.werks/1496 b/.werks/1496
new file mode 100644
index 0000000..0077d79
--- /dev/null
+++ b/.werks/1496
@@ -0,0 +1,15 @@
+Title: Fixed exception after editing a dashboard as user without permission to publish
dashboards
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1415696641
+
+When a user without permission to publish a dashboard created or customized a dashboard,
+the dashboard could be saved, but resulted in an exception later during rendering the
+following pages. This fix prevents creation of damages dashboards.
+
+The exception can be fixed by removing the dashboard definition from
var/check_mk/web/USER/user_dashboards.mk
+or simply removing the whole file, which would delete all custom dashboards of the user.
diff --git a/ChangeLog b/ChangeLog
index f26c72c..67b71d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,7 @@
* 1488 FIX: Fixed wrong information showing up on "Host Group" and
"Service Group" views...
* 1433 FIX: Quicksearch: no longer shows an invalid search result when looking for
multiple hosts...
* 1494 FIX: Fixed error in NagVis Maps snapin when some users had no contact groups
assigned
+ * 1496 FIX: Fixed exception after editing a dashboard as user without permission to
publish dashboards...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 1245c9d..d06a733 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -667,6 +667,9 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
for key, title in visibility_choices:
visual[key] = key in general_properties['visibility']
+ if not config.may("general.publish_" + what):
+ visual['public'] = False
+
if create_handler:
visual = create_handler(old_visual, visual)