diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx index 50cee215eb9..f3f1e79ac2a 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx @@ -4,9 +4,9 @@ import GuardrailsPanel from "@/components/guardrails"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; const GuardrailsPage = () => { - const { accessToken } = useAuthorized(); + const { accessToken, userRole } = useAuthorized(); - return ; + return ; }; export default GuardrailsPage; diff --git a/ui/litellm-dashboard/src/components/guardrails.tsx b/ui/litellm-dashboard/src/components/guardrails.tsx index fee9d02d3ae..c2bc4a903a9 100644 --- a/ui/litellm-dashboard/src/components/guardrails.tsx +++ b/ui/litellm-dashboard/src/components/guardrails.tsx @@ -252,7 +252,7 @@ const GuardrailsPanel: React.FC = ({ accessToken, userRole { key: "submitted", label: "Submitted Guardrails", - children: , + children: , }, ]} /> diff --git a/ui/litellm-dashboard/src/components/guardrails/TeamGuardrailsTab.tsx b/ui/litellm-dashboard/src/components/guardrails/TeamGuardrailsTab.tsx index b03ac92ba2b..8ba26553c42 100644 --- a/ui/litellm-dashboard/src/components/guardrails/TeamGuardrailsTab.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/TeamGuardrailsTab.tsx @@ -25,6 +25,7 @@ import { import NotificationsManager from "@/components/molecules/notifications_manager"; import TeamDropdown from "@/components/common_components/team_dropdown"; import { useRegisterGuardrail } from "@/app/(dashboard)/hooks/guardrails/useRegisterGuardrail"; +import { isAdminRole } from "@/utils/roles"; type GuardrailStatus = "active" | "pending" | "rejected"; @@ -229,6 +230,7 @@ type GuardrailCardProps = { guardrail: TeamGuardrail; isSelected: boolean; isHeadersExpanded: boolean; + isAdmin: boolean; onSelect: () => void; onToggleForwardKey: () => void; onToggleHeaders: () => void; @@ -240,6 +242,7 @@ function GuardrailCard({ guardrail: g, isSelected, isHeadersExpanded, + isAdmin, onSelect, onToggleForwardKey, onToggleHeaders, @@ -304,7 +307,7 @@ function GuardrailCard({ > {isSelected ? "Close" : "Review"} - {g.status === "pending" && ( + {isAdmin && g.status === "pending" && ( <> - {g.status === "pending" && ( + {isAdmin && g.status === "pending" && (