Module: check_mk
Branch: master
Commit: 26a2861f9ce03707adc88d1ba8bec7624c820131
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26a2861f9ce037…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 6 15:53:10 2016 +0200
3328 Default cloned views to be not public
If you create a view as a clone from an existing view than the new view
defaults <b>not</b> to be public. Previously the public-flag was cloned
as well. That could lead into trouble by an admin overriding the views of
others by that way.
---
.werks/3328 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 2 ++
3 files changed, 16 insertions(+)
diff --git a/.werks/3328 b/.werks/3328
new file mode 100644
index 0000000..2c78926
--- /dev/null
+++ b/.werks/3328
@@ -0,0 +1,13 @@
+Title: Default cloned views to be not public
+Level: 2
+Component: multisite
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459950688
+
+If you create a view as a clone from an existing view than the new view
+defaults <b>not</b> to be public. Previously the public-flag was cloned
+as well. That could lead into trouble by an admin overriding the views of
+others by that way.
diff --git a/ChangeLog b/ChangeLog
index 91b9bb1..5ae17e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -140,6 +140,7 @@
* 3297 SEC: Fixes possible XSS in views sidebar snapin...
* 2237 Unique name for columns of Host Groups and Service Groups...
* 3310 New dashlet which shows user notifications
+ * 3328 Default cloned views to be not public...
* 3059 FIX: Fixed highlighting of availability timeline time slices
* 3175 FIX: Fix timeranges of graphs that are embedded in a dashboard...
* 3076 FIX: fixed broken views in check_mk raw edition
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 2bafd63..13e07b5 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -581,6 +581,7 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
n += 1
newname = visualname + "_clone%d" % n
visual["name"] = newname
+ visual["public"] = False
visualname = newname
oldname = None # Prevent renaming
if cloneuser == config.user_id:
@@ -592,6 +593,7 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
mode = 'clone'
if not visual:
raise MKGeneralException(_('The requested %s does not
exist.') % visual_types[what]['title'])
+ visual["public"] = False
single_infos = visual['single_infos']