Module: check_mk
Branch: master
Commit: a23232de1942c371dba3e3d47895d9b2999ecfa1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a23232de1942c3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 18 15:59:45 2012 +0100
FIX: Fixed problem with duplicate permissions when using the i18n of multiisite
---
ChangeLog | 1 +
web/htdocs/config.py | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fa96d20..1673ec2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@
* FIX: Fixed missing folders in "move to" dropdown fields
* FIX: Fixed "move to target folders" after CSV import
* FIX: Fixed problem with duplicate extra_buttons when using the i18n of multiisite
+ * 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
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 0197bfd..ab1c968 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -148,8 +148,16 @@ permission_sections = {}
def declare_permission(name, title, description, defaults):
perm = { "name" : name, "title" : title, "description"
: description, "defaults" : defaults }
+
+ # Detect if this permission has already been declared before
+ # The dict value is replaced automatically but the list value
+ # to be replaced -> INPLACE!
+ if perm in permissions_by_order:
+ permissions_by_order[permissions_by_order.index(perm)] = perm
+ else:
+ permissions_by_order.append(perm)
+
permissions_by_name[name] = perm
- permissions_by_order.append(perm)
def declare_permission_section(name, title):
permission_sections[name] = title