mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
Add admin check.
This commit is contained in:
parent
c90bd941b5
commit
39ea100f2a
20 changed files with 133 additions and 98 deletions
|
|
@ -25,13 +25,10 @@ export default async (
|
|||
await useCors(req, res);
|
||||
await useAuth(req, res);
|
||||
|
||||
const {
|
||||
user: { id: userId },
|
||||
} = req.auth;
|
||||
const { id: websiteId, startAt, endAt, unit, tz, url, eventName } = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (canViewWebsite(userId, websiteId)) {
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue