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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user