account system and syslogs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { getSessionRole } from "@/lib/auth/require-session";
|
||||
import { getSessionAccount } from "@/lib/auth/require-session";
|
||||
import { canReadPage } from "@/lib/auth/permissions";
|
||||
import {
|
||||
parseMatchIdParam,
|
||||
readMatchLogFile,
|
||||
@@ -8,8 +9,11 @@ export async function GET(
|
||||
_request: Request,
|
||||
context: { params: Promise<{ matchId: string }> },
|
||||
) {
|
||||
const role = await getSessionRole();
|
||||
if (!role) {
|
||||
const account = await getSessionAccount();
|
||||
if (
|
||||
!account ||
|
||||
(!canReadPage(account, "matches") && !canReadPage(account, "analysis"))
|
||||
) {
|
||||
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user