mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Fixed sticky header scrolling. Updated settings button.
This commit is contained in:
parent
5262d19c8b
commit
bb99b3eba5
16 changed files with 109 additions and 134 deletions
10
lib/auth.ts
10
lib/auth.ts
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue