Skip to content

Commit f984824

Browse files
committed
RBAC: render conditional cells as plain dimmed text (no tick + badge)
1 parent 7d48bf4 commit f984824

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.roles

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.roles/route.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,21 +339,22 @@ function RoleCell({
339339
);
340340
}
341341

342-
// At least one allow rule applies. Render ✓ in success green; if
343-
// there's a conditional cannot rule, render its label as a Badge
344-
// alongside the tick so the user sees the restriction.
342+
// At least one allow rule applies. If there's a conditional cannot
343+
// rule, replace the ✓ with just the condition label so the user sees
344+
// the restriction without a misleading tick. Plain unconditional
345+
// allow keeps the ✓.
345346
const conditionalDeny = denied.find((p) => p.conditions);
346-
return (
347-
<div className="flex items-center gap-1">
348-
<span className="text-success" aria-label="Allowed">
349-
<CheckIcon className="size-4" />
347+
if (conditionalDeny?.conditions) {
348+
return (
349+
<span className="text-xs text-text-dimmed">
350+
{conditionLabel(conditionalDeny.conditions)}
350351
</span>
351-
{conditionalDeny?.conditions ? (
352-
<Badge variant="extra-small">
353-
{conditionLabel(conditionalDeny.conditions)}
354-
</Badge>
355-
) : null}
356-
</div>
352+
);
353+
}
354+
return (
355+
<span className="text-success" aria-label="Allowed">
356+
<CheckIcon className="size-4" />
357+
</span>
357358
);
358359
}
359360

@@ -363,8 +364,8 @@ function RoleCell({
363364
// grows.
364365
function conditionLabel(conditions: Record<string, unknown>): string {
365366
if (typeof conditions.envType === "string") {
366-
if (conditions.envType === "PRODUCTION") return "non-prod only";
367-
return `non-${conditions.envType.toLowerCase()} only`;
367+
if (conditions.envType === "PRODUCTION") return "Non-prod only";
368+
return `Non-${conditions.envType.toLowerCase()} only`;
368369
}
369370
return JSON.stringify(conditions);
370371
}

0 commit comments

Comments
 (0)