feat(settings): restrict AI readiness checks to admins

This commit is contained in:
2026-03-30 11:00:42 +02:00
parent 81a46c81bd
commit c8e82ac221
5 changed files with 80 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { z } from "zod";
import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc.js";
import { adminProcedure, createTRPCRouter } from "../trpc.js";
import { createAiClient, isAiConfigured, parseAiError } from "../ai-client.js";
import { DEFAULT_SUMMARY_PROMPT } from "./resource.js";
import { VALUE_SCORE_WEIGHTS } from "@capakraken/shared";
@@ -361,7 +361,7 @@ export const settingsRouter = createTRPCRouter({
}
}),
getAiConfigured: protectedProcedure.query(async ({ ctx }) => {
getAiConfigured: adminProcedure.query(async ({ ctx }) => {
const settings = await ctx.db.systemSettings.findUnique({
where: { id: "singleton" },
select: {