Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Mike Cao 2024-02-02 17:49:30 -08:00
commit a91b9c9716
5 changed files with 22 additions and 8 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);