Skip to content

armgit / umami

Public Imported from GitHub
0

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.

Add version.

Brian Cao5a8543fd250d
diff --git a/package.components.json b/package.components.json
index 41e72579f..601722486 100644
--- a/package.components.json
+++ b/package.components.json
@@ -1,6 +1,6 @@
{
"name": "@umami/components",
- "version": "0.1.0",
+ "version": "0.40.0",
"description": "Umami React components.",
"author": "Mike Cao <[email protected]>",
"license": "MIT",
diff --git a/src/lib/auth.ts b/src/lib/auth.ts
index 371e619a1..eb3100154 100644
--- a/src/lib/auth.ts
+++ b/src/lib/auth.ts
@@ -166,14 +166,14 @@ export async function canViewTeam({ user }: Auth, teamId: string) {
}
export async function canUpdateTeam({ user, grant }: Auth, teamId: string) {
- if (cloudMode) {
- return !!grant?.find(a => a === PERMISSIONS.teamUpdate);
- }
-
if (user.isAdmin) {
return true;
}
+ if (cloudMode) {
+ return !!grant?.find(a => a === PERMISSIONS.teamUpdate);
+ }
+
const teamUser = await getTeamUser(teamId, user.id);
return teamUser && hasPermission(teamUser.role, PERMISSIONS.teamUpdate);