1
0
forked from baron/baron-sso

feat: allow regular users to view their own tenant's org chart

Changes the /users endpoint to allow RoleUser access and securely restricts the returned data to only users within their affiliated tenants. Removes the unnecessary back button from the Org Chart view since it's now a top-level nav item.
This commit is contained in:
2026-04-13 10:47:56 +09:00
parent 984adcfa62
commit d3a82d1653
4 changed files with 39 additions and 24 deletions

View File

@@ -125,11 +125,15 @@ function AppLayout() {
icon: Building2,
});
}
filteredItems.splice(manageableCount <= 1 && profile?.tenantId ? 2 : 2, 0, {
label: "ui.admin.nav.org_chart",
to: "/tenants/org-chart",
icon: Network,
});
filteredItems.splice(
manageableCount <= 1 && profile?.tenantId ? 2 : 2,
0,
{
label: "ui.admin.nav.org_chart",
to: "/tenants/org-chart",
icon: Network,
},
);
} else {
// 일반 사용자(Tenant Member)도 조직도 메뉴를 볼 수 있도록 추가합니다.
filteredItems.splice(1, 0, {
@@ -439,9 +443,9 @@ function AppLayout() {
{navItems.map(({ label, to, icon: Icon }) => {
const isOrgChart = location.pathname === "/tenants/org-chart";
const isTenantsRoot = to === "/tenants";
const isCustomActive = isTenantsRoot
? (location.pathname.startsWith("/tenants") && !isOrgChart)
: to === "/"
const isCustomActive = isTenantsRoot
? location.pathname.startsWith("/tenants") && !isOrgChart
: to === "/"
? location.pathname === "/"
: location.pathname.startsWith(to);