mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
Fix share URL permissions.
This commit is contained in:
parent
05c7196bc6
commit
cc46cfdcbf
3 changed files with 23 additions and 15 deletions
|
|
@ -7,6 +7,7 @@ export default async (req, res) => {
|
|||
await useAuth(req, res);
|
||||
|
||||
const { user_id, include_all } = req.query;
|
||||
|
||||
const { userId: currentUserId, isAdmin } = req.auth;
|
||||
const accountUuid = user_id || req.auth.accountUuid;
|
||||
let account;
|
||||
|
|
@ -18,7 +19,7 @@ export default async (req, res) => {
|
|||
const userId = account ? account.id : user_id;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (userId && userId !== currentUserId && !isAdmin) {
|
||||
if (!userId || (userId !== currentUserId && !isAdmin)) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue