feat(frontend): add group permissions (#721)

* style(frontend): 💄 add darktheme custom

* add dummy users in dev mode

* feat(frontend):  add group permissions editor UI

* feat(backend):  add group permissions setters

* test(backend):  tests for basic permission get/set (WIP)

Needs more testing

* remove old test

* chore(backend): copy template.env on setup

* feat(frontend):  enable send invitation via email

* feat(backend):  enable send invitation via email

* feat:  add app config checker for site-settings

* refactor(frontend): ♻️ consolidate bool checks

Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-10-04 20:16:37 -08:00
committed by GitHub
parent b7b8aa9a08
commit 5d43fac7c9
43 changed files with 652 additions and 106 deletions

View File

@@ -23,3 +23,8 @@ class AdminAboutInfo(AppInfo):
db_type: str
db_url: Path
default_group: str
class CheckAppConfig(CamelModel):
email_ready: bool = False
base_url_set: bool = False

View File

@@ -0,0 +1,8 @@
from fastapi_camelcase import CamelModel
class SetPermissions(CamelModel):
user_id: int
can_manage: bool = False
can_invite: bool = False
can_organize: bool = False

View File

@@ -18,3 +18,13 @@ class ReadInviteToken(CamelModel):
class Config:
orm_mode = True
class EmailInvitation(CamelModel):
email: str
token: str
class EmailInitationResponse(CamelModel):
success: bool
error: str = None

View File

@@ -55,6 +55,10 @@ class UserBase(CamelModel):
advanced: bool = False
favorite_recipes: Optional[list[str]] = []
can_invite: bool = False
can_manage: bool = False
can_organize: bool = False
class Config:
orm_mode = True