From c0f4a84c9345a331c246c0da17ffc1319fdac3c3 Mon Sep 17 00:00:00 2001 From: riyadhafraa <49757212-riyadhafraa@users.noreply.replit.com> Date: Tue, 19 May 2026 14:14:52 +0000 Subject: [PATCH] Improve user role management by clarifying inherited permissions Update the user role toggle to reflect direct role assignments, disable the toggle if the role is inherited, and display an inherited badge. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b813888e-26a9-4feb-8414-3c57fdc104d6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/IO8TMSC Replit-Helium-Checkpoint-Created: true --- .replit | 4 ++++ artifacts/tx-os/src/pages/admin.tsx | 31 +++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.replit b/.replit index 775d1e6c..bb511488 100644 --- a/.replit +++ b/.replit @@ -64,6 +64,10 @@ externalPort = 4200 localPort = 5001 externalPort = 3001 +[[ports]] +localPort = 5002 +externalPort = 6800 + [[ports]] localPort = 8080 externalPort = 8080 diff --git a/artifacts/tx-os/src/pages/admin.tsx b/artifacts/tx-os/src/pages/admin.tsx index 64e7790c..dc0dacbc 100644 --- a/artifacts/tx-os/src/pages/admin.tsx +++ b/artifacts/tx-os/src/pages/admin.tsx @@ -4369,24 +4369,27 @@ function UsersPanel({ {(() => { - // The Switch toggles the DIRECT user_roles row only. If - // the role is inherited via a group (present in `roles` - // but not in `directRoles`), removing the direct row is a - // no-op and the Switch would flip back on after refetch. - // Disable it and show which group grants the role so the - // admin edits group membership instead. + // The Switch toggles the DIRECT user_roles row only. + // When the role is also inherited via a group, we show + // a small badge so the admin understands removing the + // direct row may not revoke effective access. const hasEffective = u.roles?.includes("order_receiver") ?? false; const hasDirect = u.directRoles?.includes("order_receiver") ?? false; const isInherited = hasEffective && !hasDirect; return ( ); })()}