mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Add version.
This commit is contained in:
parent
6ab57a1ace
commit
5a8543fd25
@ -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",
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user