mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-17 14:55:53 +02:00
scopes
This commit is contained in:
@ -18,7 +18,18 @@ class PermissionScopes(BaseScopes):
|
||||
and can be useful to make queries through the API with limited privileges.
|
||||
"""
|
||||
|
||||
def get_all_scopes(self):
|
||||
def get_all_scopes(self, **kwargs):
|
||||
scopes = {}
|
||||
if 'scopes' in kwargs:
|
||||
for scope in kwargs['scopes']:
|
||||
if scope == 'openid' :
|
||||
scopes['openid'] = "OpenID Connect"
|
||||
else:
|
||||
p = Permission.objects.get(id=scope.split('_')[0])
|
||||
club = Club.objects.get(id=scope.split('_')[1])
|
||||
scopes[scope] = f"{p.description} (club {club.name})"
|
||||
return scopes
|
||||
|
||||
scopes = {f"{p.id}_{club.id}": f"{p.description} (club {club.name})"
|
||||
for p in Permission.objects.all() for club in Club.objects.all()}
|
||||
scopes['openid'] = "OpenID Connect"
|
||||
|
Reference in New Issue
Block a user