Module: check_mk
Branch: master
Commit: 082491e4f0fe4451c911dbce2510b56e08ccf697
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=082491e4f0fe44…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 19 08:48:06 2012 +0100
FIX: Fixed wrong folder contacgroup related permissions in auth.php api
---
ChangeLog | 1 +
web/htdocs/wato.py | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1673ec2..b448b08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
* FIX: Fixed problem with duplicate permissions when using the i18n of multiisite
* FIX: Writing single host_contactgroups rules for each selected
contactgroup in host edit dialog
+ * FIX: Fixed wrong folder contacgroup related permissions in auth.php api
BI:
* improve doc/treasures/check_bi_local.py: local check that creates
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ab0afa8..3d9375e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -897,6 +897,7 @@ def get_folder_permissions_of_users(users):
permissions = {}
+ users = load_users()
for username in users.iterkeys():
permissions[username] = {}
for folder_path, folder in folders.iteritems():
@@ -922,12 +923,15 @@ def check_folder_permissions(folder, how, exception=True, user =
None):
effective = effective_attributes(None, folder)
use, cgs = effective.get("contactgroups", (None, []))
+ if not user:
+ user = config.user_id
+
# Get contact groups of user
users = load_users()
- if config.user_id not in users:
+ if user not in users:
user_cgs = []
else:
- user_cgs = users[config.user_id].get("contactgroups", [])
+ user_cgs = users[user].get("contactgroups", [])
for c in user_cgs:
if c in cgs: