diff options
Diffstat (limited to 'qvisqve/authn_entity_manager.py')
-rw-r--r-- | qvisqve/authn_entity_manager.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qvisqve/authn_entity_manager.py b/qvisqve/authn_entity_manager.py index 68d0c3e..f84634c 100644 --- a/qvisqve/authn_entity_manager.py +++ b/qvisqve/authn_entity_manager.py @@ -56,21 +56,21 @@ class AuthenticatingEntityManager(qvisqve.EntityManager): entity_id=entity_id) return True + def set_allowed_scopes(self, entity_id, scopes): + entity = self.get(entity_id) + entity['allowed_scopes'] = scopes + self.create(entity_id, entity) + + def get_allowed_scopes(self, entity_id): + entity = self.get(entity_id) + return entity.get('allowed_scopes', []) + class ClientManager(AuthenticatingEntityManager): def __init__(self, rs): super().__init__(rs, 'client') - def set_allowed_scopes(self, client_id, scopes): - client = self.get(client_id) - client['allowed_scopes'] = scopes - self.create(client_id, client) - - def get_allowed_scopes(self, client_id): - client = self.get(client_id) - return client.get('allowed_scopes', []) - class UserManager(AuthenticatingEntityManager): |