feat: re-eng roles

This commit is contained in:
swve 2023-05-07 18:19:36 +00:00
parent 4e5f6cf966
commit a134316f7a
4 changed files with 16 additions and 5 deletions

View file

@ -87,6 +87,10 @@ async def create_org(request: Request, org_object: Organization, current_user: P
# add org to user
await user.update_one({"user_id": current_user.user_id}, {
"$addToSet": {"orgs": user_organization.dict()}})
# add role admin to org
await user.update_one({"user_id": current_user.user_id}, {
"$addToSet": {"roles": {"org_id": org_id, "role_id": "role_admin"}}})
if not org_in_db:
raise HTTPException(