mirror of
https://github.com/Noettore/lagomareGateKeeperBot.git
synced 2025-10-17 04:26:40 +02:00
Still refactoring and unit tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from models import Status, Role, Credential, Grant, User
|
||||
from repository import UsersRepository
|
||||
from src.models import Status, Role, Credential, Grant, User
|
||||
from src.repository import UsersRepository
|
||||
|
||||
|
||||
class UsersService:
|
||||
@@ -81,7 +81,7 @@ class UsersService:
|
||||
return self._users_repository.get_by_uid(grant.grantor) if grant else None
|
||||
|
||||
def get_admins(self) -> list[str]:
|
||||
return [user.id for user in self._users_repository.get_all() if user.role == Role.ADMIN]
|
||||
return [user.uid for user in self._users_repository.get_all() if user.role == Role.ADMIN]
|
||||
|
||||
def grant_access(self, uid: str, gate: str, expires_at: datetime, grantor_id: str) -> bool:
|
||||
user = self._users_repository.get_by_uid(uid)
|
||||
|
Reference in New Issue
Block a user