File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ import logging
2+
13from oauth2_provider .oauth2_validators import OAuth2Validator
24
5+ logger = logging .getLogger (__name__ )
6+
37
48class IonOIDCValidator (OAuth2Validator ):
59 oidc_claim_scope = OAuth2Validator .oidc_claim_scope .copy ()
6- oidc_claim_scope .update ({"groups" : "groups" }) # manually add it since groups is not part of the standard OIDC spec
10+ oidc_claim_scope .update ({"groups" : "groups" , "is_sysadmin" : "groups" }) # manually add it since groups is not part of the standard OIDC spec
711
812 def get_additional_claims (self , request ):
913 claims = {}
@@ -31,6 +35,7 @@ def get_additional_claims(self, request):
3135 claims .update (
3236 {
3337 "groups" : list (user .groups .values_list ("name" , flat = True )),
38+ "is_sysadmin" : user .groups .filter (name = "Sysadmin(R) -- Permissions" ).exists (),
3439 }
3540 )
3641
You can’t perform that action at this time.
0 commit comments