Fixed sticky header scrolling. Updated settings button.
This commit is contained in:
1 parent
5262d19c8b
commit
bb99b3eba5
16 files changed
+109
-134
No files matched your search
+7
-3
@@ -50,8 +50,12 @@ export function isValidToken(token, validation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function canViewWebsite({ user }: Auth, websiteId: string) {
|
||||
if (user.isAdmin) {
|
||||
export async function canViewWebsite({ user, shareToken }: Auth, websiteId: string) {
|
||||
if (user?.isAdmin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (shareToken?.websiteId === websiteId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,7 +76,7 @@ export async function canCreateWebsite({ user }: Auth, teamId?: string) {
|
||||
if (teamId) {
|
||||
const teamUser = await getTeamUser(teamId, user.id);
|
||||
|
||||
return hasPermission(teamUser.role, PERMISSIONS.websiteCreate);
|
||||
return hasPermission(teamUser?.role, PERMISSIONS.websiteCreate);
|
||||
}
|
||||
|
||||
return hasPermission(user.role, PERMISSIONS.websiteCreate);
|
||||
|
||||
Reference in new issue
Block a user