Module: check_mk
Branch: master
Commit: ed044ce089d3ee7fedd90d5852192f36cd6bac2d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed044ce089d3ee…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 27 09:17:40 2015 +0100
#1879 FIX Not showing "only show permitted hosts/services" option for users not
having "see all" permissions
This option is only meant to reduce the amount of seen hosts/services of a user having
the
"see all hosts/services" permission to the hosts/services which the user is
really assigned
to. To configure this option makes only sense for users having the "see all"
permissions. Now
WATO only shows the checkboxes for these users.
---
.werks/1879 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/config.py | 4 ++--
web/htdocs/wato.py | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1879 b/.werks/1879
new file mode 100644
index 0000000..1e83f73
--- /dev/null
+++ b/.werks/1879
@@ -0,0 +1,13 @@
+Title: Not showing "only show permitted hosts/services" option for users not
having "see all" permissions
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422346516
+
+This option is only meant to reduce the amount of seen hosts/services of a user having
the
+"see all hosts/services" permission to the hosts/services which the user is
really assigned
+to. To configure this option makes only sense for users having the "see all"
permissions. Now
+WATO only shows the checkboxes for these users.
diff --git a/ChangeLog b/ChangeLog
index 2a10f6c..a5bf6ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 1211 FIX: Fixed g_git_messages error on activate changes...
* 1212 FIX: Fixed default value in wato parameter page for timeperiods...
* 1816 FIX: Fixed garbled output on "rename host" result page
+ * 1879 FIX: Not showing "only show permitted hosts/services" option for
users not having "see all" permissions...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index feda21c..a07f4bb 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -353,8 +353,8 @@ def may(pname):
user_permissions[pname] = he_may
return he_may
-def user_may(u, pname):
- return may_with_roles(roles_of_user(u), pname)
+def user_may(user_id, pname):
+ return may_with_roles(roles_of_user(user_id), pname)
def need_permission(pname):
if not may(pname):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ffe8f34..9f0d82d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11883,7 +11883,7 @@ def mode_edit_user(phase):
if topic is not None and topic != attr['topic']:
continue # skip attrs of other topics
- if not attr.get("permission") or
config.may(attr["permission"]):
+ if not userid or not attr.get("permission") or
config.user_may(userid, attr["permission"]):
vs = attr['valuespec']
forms.section(_u(vs.title()))
if attr['user_editable'] and not is_locked(name):