Module: check_mk
Branch: master
Commit: 9f9078e77dc5da89216e7990a9ef137593945a99
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f9078e77dc5da…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 2 10:42:52 2012 +0100
WATO: force user to have at least one role
---
web/htdocs/wato.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 27e027f..8585138 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6729,6 +6729,10 @@ def mode_edit_user(phase):
'the user member of a contact group which has hosts assigned
'
'in order to be able to receive emails.'))
+ if not new_user["roles"]:
+ raise MKUserError("role_user",
+ _("Your user has no roles. Please assign at least one
role."))
+
ntp = html.var("notification_period")
if ntp not in timeperiods:
ntp = "24X7"