Merge branch 'dev' of https://github.com/umami-software/umami into dev
# Conflicts: # public/iso-3166-2.json
This commit is contained in:
@@ -95,17 +95,11 @@ export async function canViewWebsite({ user, shareToken }: Auth, websiteId: stri
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function canCreateWebsite({ user }: Auth, teamId?: string) {
|
||||
export async function canCreateWebsite({ user }: Auth) {
|
||||
if (user.isAdmin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (teamId) {
|
||||
const teamUser = await getTeamUser(teamId, user.id);
|
||||
|
||||
return hasPermission(teamUser?.role, PERMISSIONS.websiteCreate);
|
||||
}
|
||||
|
||||
return hasPermission(user.role, PERMISSIONS.websiteCreate);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
password?: string;
|
||||
role: string;
|
||||
createdAt?: Date;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user