Remove webisite.teamId related code. Clean up queries.
This commit is contained in:
1 parent
081a126c01
commit
0335fd3529
4 files changed
+8
-19
No files matched your search
+1
-7
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user