Tighten API access checks by website section and share permissions

This commit is contained in:
Mike Cao committed 2026-06-02 15:29:23 -07:00
1 parent 8bc49a29e3
commit ade0819be1
69 files changed
+303 -188

No files matched your search

+2 -2
View File
@@ -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();
}