Module: check_mk
Branch: master
Commit: 4fea9b61af0cf6f24d85dd39d0db454284c135a5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fea9b61af0cf6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Mar 25 12:18:58 2012 +0200
New function for getting a users alias
---
web/htdocs/config.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 5701af6..9e88fdf 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -335,6 +335,13 @@ def roles_of_user(user):
else:
return []
+def alias_of_user(user):
+ if user in multisite_users:
+ return multisite_users[user].get("alias", user)
+ else:
+ return user
+
+
def base_roles_of(some_roles):
base_roles = set([])
for r in some_roles: