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

@ -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);