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,7 +2,7 @@ import { z } from 'zod';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { filterParams } from '@/lib/schema';
import { canViewWebsite } from '@/permissions';
import { canViewAuthenticatedWebsite } from '@/permissions';
import { getEventDataStats } from '@/queries/sql';
export async function GET(
@@ -23,7 +23,7 @@ export async function GET(
const { websiteId } = await params;
if (!(await canViewWebsite(auth, websiteId))) {
if (!(await canViewAuthenticatedWebsite(auth, websiteId))) {
return unauthorized();
}