Add version.

This commit is contained in:
Brian Cao 2024-02-01 13:35:34 -08:00
parent 6ab57a1ace
commit 5a8543fd25
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@umami/components", "name": "@umami/components",
"version": "0.1.0", "version": "0.40.0",
"description": "Umami React components.", "description": "Umami React components.",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",

View File

@ -166,14 +166,14 @@ export async function canViewTeam({ user }: Auth, teamId: string) {
} }
export async function canUpdateTeam({ user, grant }: Auth, teamId: string) { export async function canUpdateTeam({ user, grant }: Auth, teamId: string) {
if (cloudMode) {
return !!grant?.find(a => a === PERMISSIONS.teamUpdate);
}
if (user.isAdmin) { if (user.isAdmin) {
return true; return true;
} }
if (cloudMode) {
return !!grant?.find(a => a === PERMISSIONS.teamUpdate);
}
const teamUser = await getTeamUser(teamId, user.id); const teamUser = await getTeamUser(teamId, user.id);
return teamUser && hasPermission(teamUser.role, PERMISSIONS.teamUpdate); return teamUser && hasPermission(teamUser.role, PERMISSIONS.teamUpdate);