mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: re-eng roles
This commit is contained in:
parent
4e5f6cf966
commit
a134316f7a
4 changed files with 16 additions and 5 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue