Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Restrict team owner assignment to admins
Mike Cao5bf1792b3859
diff --git a/src/app/api/teams/route.ts b/src/app/api/teams/route.tsindex 6c79be7fc..43fe235d8 100644--- a/src/app/api/teams/route.ts+++ b/src/app/api/teams/route.ts@@ -47,7 +47,7 @@ export async function POST(request: Request) {const { name, ownerId } = body;const teamId = uuid();- const teamOwnerId = ownerId ?? auth.user.id;+ const teamOwnerId = ownerId && auth.user.isAdmin ? ownerId : auth.user.id;const team = await createTeam({