From 366e44b75a62c8df2ded805d35d1ac07d9820ca0 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 21 Jul 2026 03:22:48 -0600 Subject: [PATCH] fix(ai): only show Custom Presets button to owner/admin roles --- apps/dokploy/components/dashboard/settings/ai-form.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/settings/ai-form.tsx b/apps/dokploy/components/dashboard/settings/ai-form.tsx index 743092525..797aad23c 100644 --- a/apps/dokploy/components/dashboard/settings/ai-form.tsx +++ b/apps/dokploy/components/dashboard/settings/ai-form.tsx @@ -18,6 +18,9 @@ import { HandleAiProviders } from "./handle-ai-providers"; export const AiForm = () => { const { data: aiConfigs, refetch, isPending } = api.ai.getAll.useQuery(); const { mutateAsync, isPending: isRemoving } = api.ai.delete.useMutation(); + const { data: currentUser } = api.user.get.useQuery(); + const isOrgAdmin = + currentUser?.role === "owner" || currentUser?.role === "admin"; return (
@@ -32,7 +35,7 @@ export const AiForm = () => { Manage your AI configurations
- + {isOrgAdmin && } {aiConfigs && aiConfigs?.length > 0 && }