Tighten API access checks by website section and share permissions
This commit is contained in:
1 parent
8bc49a29e3
commit
ade0819be1
69 files changed
+303
-188
No files matched your search
@@ -3,7 +3,7 @@ import { uuid } from '@/lib/crypto';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { json, unauthorized } from '@/lib/response';
|
||||
import { pagingParams, reportSchema, reportTypeParam } from '@/lib/schema';
|
||||
import { canUpdateWebsite, canViewWebsite } from '@/permissions';
|
||||
import { canUpdateWebsite, canViewAuthenticatedWebsite } from '@/permissions';
|
||||
import { createReport, getReports } from '@/queries/prisma';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
@@ -26,7 +26,7 @@ export async function GET(request: Request) {
|
||||
search,
|
||||
};
|
||||
|
||||
if (!(await canViewWebsite(auth, websiteId))) {
|
||||
if (!(await canViewAuthenticatedWebsite(auth, websiteId))) {
|
||||
return unauthorized();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user