Skip to content

Commit c29d4da

Browse files
committed
fix(access-control): default deniedModels in response schema, hide blocked badge on disabled rows, trim comments
1 parent 8511b32 commit c29d4da

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

apps/sim/ee/access-control/components/access-control.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,7 @@ function AccessControlSkeleton() {
256256
)
257257
}
258258

259-
/**
260-
* Providers whose model catalog is discovered at runtime from a user-configured
261-
* endpoint rather than the static {@link PROVIDER_DEFINITIONS} list. Their models
262-
* are fetched lazily via {@link useProviderModels} when a row is expanded.
263-
*/
259+
/** Providers whose models are fetched at runtime (on row expand) rather than from {@link PROVIDER_DEFINITIONS}. */
264260
const DYNAMIC_MODEL_PROVIDERS = new Set<ProviderName>([
265261
'ollama',
266262
'vllm',
@@ -419,7 +415,7 @@ function ProviderRow({
419415
)}
420416
>
421417
<span className='truncate font-medium text-sm'>{providerName}</span>
422-
{deniedCount > 0 && (
418+
{isProviderAllowed && deniedCount > 0 && (
423419
<span className='rounded-sm bg-[var(--surface-3)] px-1.5 py-0.5 text-[var(--text-muted)] text-micro'>
424420
{deniedCount} blocked
425421
</span>
@@ -1000,7 +996,7 @@ export function AccessControl() {
1000996
const providerId = getProviderFromModel(model)
1001997
counts[providerId] = (counts[providerId] ?? 0) + 1
1002998
} catch {
1003-
// Model maps to an unavailable provider (e.g. server-blacklisted); skip its badge.
999+
// Unknown/blacklisted provider — omit from counts.
10041000
}
10051001
}
10061002
return counts

apps/sim/lib/api/contracts/permission-groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { permissionGroupConfigSchema } from '@/lib/permission-groups/types'
55
export const permissionGroupFullConfigSchema = z.object({
66
allowedIntegrations: z.array(z.string()).nullable(),
77
allowedModelProviders: z.array(z.string()).nullable(),
8-
deniedModels: z.array(z.string()),
8+
deniedModels: z.array(z.string()).default([]),
99
hideTraceSpans: z.boolean(),
1010
hideKnowledgeBaseTab: z.boolean(),
1111
hideTablesTab: z.boolean(),

apps/sim/lib/permission-groups/types.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ export interface PermissionGroupConfig {
3434
allowedIntegrations: string[] | null
3535
allowedModelProviders: string[] | null
3636
/**
37-
* Denylist of fully-qualified model IDs (e.g. `ollama/llama3`, `gpt-4o`) that
38-
* members of this group may not use. Empty means no model is blocked. Applied
39-
* on top of `allowedModelProviders`: a model is usable only when its provider
40-
* is allowed AND the model is not present here. A denylist (rather than an
41-
* allowlist) keeps dynamically-discovered models — vLLM, Ollama, LiteLLM —
42-
* usable by default as the upstream catalog changes.
37+
* Fully-qualified model IDs (e.g. `ollama/llama3`, `gpt-4o`) blocked for this
38+
* group, checked after `allowedModelProviders`. Empty means nothing is blocked.
4339
*/
4440
deniedModels: string[]
4541
hideTraceSpans: boolean

0 commit comments

Comments
 (0)