MCPcopy
hub / github.com/learnhouse/learnhouse / require_org_admin

Function require_org_admin

apps/api/src/security/org_auth.py:75–81  ·  view source on GitHub ↗

Raise 403 if user is not an org admin/maintainer and not a superadmin.

(user_id: int, org_id: int, db_session: AsyncSession)

Source from the content-addressed store, hash-verified

73
74
75async def require_org_admin(user_id: int, org_id: int, db_session: AsyncSession) -> None:
76 """Raise 403 if user is not an org admin/maintainer and not a superadmin."""
77 if not await is_org_admin(user_id, org_id, db_session):
78 raise HTTPException(
79 status_code=status.HTTP_403_FORBIDDEN,
80 detail="Only organization administrators and maintainers can perform this action",
81 )
82
83
84async def require_org_role_permission(

Callers 14

add_custom_domainFunction · 0.90
verify_custom_domainFunction · 0.90
delete_custom_domainFunction · 0.90
create_webhook_endpointFunction · 0.90
get_webhook_endpointsFunction · 0.90
get_webhook_endpointFunction · 0.90
update_webhook_endpointFunction · 0.90
delete_webhook_endpointFunction · 0.90
send_test_eventFunction · 0.90

Calls 1

is_org_adminFunction · 0.70