forked from info-beamer/36c3-cms
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from datetime import datetime, timezone | ||
from logging import getLogger | ||
|
||
from conf import CONFIG | ||
|
||
LOG = getLogger("SSO-C3VOC") | ||
|
||
def get_c3voc_userid(userinfo_json): | ||
return "c3voc:{}".format(userinfo_json["preferred_username"]) | ||
|
||
|
||
def get_c3voc_username(userinfo_json): | ||
return "{} (C3VOC)".format(userinfo_json["preferred_username"]) | ||
|
||
|
||
def check_c3voc_allowed_login(userinfo_json): | ||
return True | ||
|
||
|
||
def check_c3voc_is_admin(userinfo_json): | ||
return "signage-admins" in userinfo_json["groups"] | ||
|
||
|
||
def check_c3voc_no_limit(userinfo_json): | ||
return "signage-no-limit" in userinfo_json["groups"] |