mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 04:25:39 +01:00
Update permissions.
This commit is contained in:
parent
f1db3d0451
commit
dd2d9dc3f5
4 changed files with 5 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ export function isValidToken(token, validation) {
|
|||
return false;
|
||||
}
|
||||
|
||||
export async function allowQuery(req, type) {
|
||||
export async function allowQuery(req, type, allowShareToken = true) {
|
||||
const { id } = req.query;
|
||||
|
||||
const { userId, isAdmin, shareToken } = req.auth ?? {};
|
||||
|
|
@ -44,7 +44,7 @@ export async function allowQuery(req, type) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (shareToken) {
|
||||
if (allowShareToken && shareToken) {
|
||||
return isValidToken(shareToken, { id });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue