mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
implemented the user view type and website sharing
This commit is contained in:
parent
7a3443cd06
commit
66e67c7a3b
19 changed files with 260 additions and 68 deletions
|
|
@ -52,7 +52,10 @@ export async function allowQuery(req, type, allowShareToken = true) {
|
|||
if (type === TYPE_WEBSITE) {
|
||||
const website = await getWebsite({ websiteUuid: id });
|
||||
|
||||
return website && website.userId === userId;
|
||||
return (
|
||||
website &&
|
||||
(website.userId === userId || website.viewers.map(v => v.userId).includes(userId))
|
||||
);
|
||||
} else if (type === TYPE_ACCOUNT) {
|
||||
const account = await getAccount({ accountUuid: id });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue