From f886f9e9dce305febeb37281857e33dd83615ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:23:33 +0000 Subject: [PATCH] add User.is_admin() --- api/kiwi_vpn_api/db/schemas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/kiwi_vpn_api/db/schemas.py b/api/kiwi_vpn_api/db/schemas.py index 4f17168..04122de 100644 --- a/api/kiwi_vpn_api/db/schemas.py +++ b/api/kiwi_vpn_api/db/schemas.py @@ -161,6 +161,9 @@ class User(UserBase): # user already existed pass + def is_admin(self) -> bool: + return UserCapability.admin in self.capabilities + def authenticate( self, db: Session,