migration, auth, refactoring, formatting

This commit is contained in:
2022-09-17 21:12:14 +03:00
parent 6b4c00d9e7
commit 3136eecd7e
68 changed files with 968 additions and 930 deletions

View File

@@ -1,6 +1,9 @@
from typing import List, Optional, Text
from pydantic import BaseModel
from base.exceptions import OperationNotAllowed
class Permission(BaseModel):
name: Text
@@ -17,7 +20,8 @@ class AuthCredentials(BaseModel):
return True
async def permissions(self) -> List[Permission]:
assert self.user_id is not None, "Please login first"
if self.user_id is not None:
raise OperationNotAllowed("Please login first")
return NotImplemented()