mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 10:35:35 +01:00
Fix share URL permissions. (#1745)
* Fix share URL permissions. * Add sql param logic. * Add permissions to edit website. * Update permissions. * Move parameters to param injection. * Sanitize eventdata. * Remove caret. * Fix avg.
This commit is contained in:
parent
558ce268a0
commit
922c3acab3
16 changed files with 139 additions and 79 deletions
|
|
@ -10,17 +10,21 @@ export default async (req, res) => {
|
|||
|
||||
const { id: websiteUuid } = req.query;
|
||||
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const website = await getWebsite({ websiteUuid });
|
||||
|
||||
return ok(res, website);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { name, domain, owner, enableShareUrl, shareId } = req.body;
|
||||
const { accountUuid } = req.auth;
|
||||
|
||||
|
|
@ -58,7 +62,7 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export default async (req, res) => {
|
|||
const { id: websiteId } = req.query;
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue