diff --git a/ui/litellm-dashboard/src/components/guardrails.tsx b/ui/litellm-dashboard/src/components/guardrails.tsx index 56bba2724d..6bb4b387a8 100644 --- a/ui/litellm-dashboard/src/components/guardrails.tsx +++ b/ui/litellm-dashboard/src/components/guardrails.tsx @@ -137,103 +137,105 @@ const GuardrailsPanel: React.FC = ({ accessToken, userRole
- Guardrail Garden - Guardrails + {isAdmin && Guardrail Garden} + {isAdmin && Guardrails} Test Playground Submitted Guardrails - {/* Guardrail Garden Tab */} - - - - - {/* Existing Guardrails Tab */} - -
- , - label: "Add Provider Guardrail", - onClick: handleAddGuardrail, - }, - { - key: "custom_code", - icon: , - label: "Create Custom Code Guardrail", - onClick: handleAddCustomCodeGuardrail, - }, - ], - }} - trigger={["click"]} - disabled={!accessToken} - > - - -
- - {selectedGuardrailId ? ( - setSelectedGuardrailId(null)} + {isAdmin && ( + + - ) : ( - + )} + + {isAdmin && ( + +
+ , + label: "Add Provider Guardrail", + onClick: handleAddGuardrail, + }, + { + key: "custom_code", + icon: , + label: "Create Custom Code Guardrail", + onClick: handleAddCustomCodeGuardrail, + }, + ], + }} + trigger={["click"]} + disabled={!accessToken} + > + + +
+ + {selectedGuardrailId ? ( + setSelectedGuardrailId(null)} + accessToken={accessToken} + isAdmin={isAdmin} + /> + ) : ( + setSelectedGuardrailId(id)} + /> + )} + + setSelectedGuardrailId(id)} + onSuccess={handleSuccess} /> - )} - + - - - -
+ +
+ )} {/* Test Playground Tab */} diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index 48df5cdde8..9005311052 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -137,7 +137,6 @@ const menuGroups: MenuGroup[] = [ page: "guardrails", label: "Guardrails", icon: , - roles: all_admin_roles, }, { key: "policies",