forked from baron/baron-sso
refactoring
This commit is contained in:
@@ -6,9 +6,7 @@ import { filterTenantsByVisibility } from "./tenantVisibility";
|
||||
import { getOrgChartUserDisplayName } from "./userDisplay";
|
||||
|
||||
function getUserTenantSlug(user: UserSummary) {
|
||||
return (
|
||||
user.companyCode?.toLowerCase() || user.tenantSlug?.toLowerCase() || ""
|
||||
);
|
||||
return user.tenantSlug?.toLowerCase() || "";
|
||||
}
|
||||
|
||||
function isOrgFrontTenantType(tenant: TenantSummary) {
|
||||
|
||||
@@ -990,8 +990,8 @@ function isSystemGlobalUser(user: UserSummary) {
|
||||
normalizedRole === "system-admin" ||
|
||||
isSystemGlobalTenant(user.tenant) ||
|
||||
isSystemGlobalTenant({
|
||||
id: user.companyCode || user.tenantSlug || "",
|
||||
slug: user.companyCode || user.tenantSlug || "",
|
||||
id: user.tenantSlug || "",
|
||||
slug: user.tenantSlug || "",
|
||||
type: user.role,
|
||||
name: user.role,
|
||||
})
|
||||
@@ -1145,8 +1145,7 @@ function buildUsersMap(
|
||||
if (!isVisibleOrgChartUser(user)) continue;
|
||||
|
||||
const slugs = new Set<string>();
|
||||
const primarySlug =
|
||||
user.companyCode?.toLowerCase() || user.tenantSlug?.toLowerCase() || "";
|
||||
const primarySlug = user.tenantSlug?.toLowerCase() || "";
|
||||
if (
|
||||
primarySlug &&
|
||||
!isSystemGlobalTenant({
|
||||
|
||||
Reference in New Issue
Block a user