From 244c3ab42e181c07e72446f8d547b96f2c8ec1f7 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Wed, 2 Dec 2026 18:52:58 +0200 Subject: [PATCH] Fixed customer entity groups missing from the "Assign entity groups to edge" dialog when a customer-owned edge is opened from Edge management (#16857) * fix(ui): list edge owner's groups in "Assign entity groups to edge" dialog The dialog listed groups of the current user's owner unless the route had a customerId, so a tenant admin opening a customer-owned edge from Edge management could not assign that customer's groups. Use the edge owner resolved with the edge instead. Fixes #16853 * fix(ui): use the edge owner in "Assign entity groups to edge" only for tenant admins For a customer user the edge owner can be outside their owner chain (an edge shared from the tenant or a parent customer). /entityGroupInfosHierarchy then returns 403 and the dialog shows an empty list. Customer users keep listing their own groups, as before. --- .../group/entity-groups-table-config.resolver.ts | 1 + .../components/group/entity-groups-table-config.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.resolver.ts b/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.resolver.ts index 15f6912b61..d534be7c9b 100644 --- a/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.resolver.ts @@ -114,6 +114,7 @@ export class EntityGroupsTableConfigResolver { return this.edgeService.getEdge(config.edgeId).pipe( map((info) => { config.tableTitle = info.name + ': ' + this.translate.instant(entityGroupsTitle(config.groupType)); + config.edgeOwnerId = info.ownerId; return config; }) ); diff --git a/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.ts b/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.ts index be3ffd2313..53b369e99b 100644 --- a/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/group/entity-groups-table-config.ts @@ -30,10 +30,12 @@ import { EntityId } from '@shared/models/id/entity-id'; import { CustomTranslatePipe } from '@shared/pipe/custom-translate.pipe'; import { AuthUser } from '@shared/models/user.model'; import { edgeCreationAllowed } from '@shared/models/edge.models'; +import { Authority } from '@shared/models/authority.enum'; export class EntityGroupsTableConfig extends EntityTableConfig { edgeId: string; + edgeOwnerId: EntityId; groupType: EntityType; shared: boolean; @@ -288,7 +290,13 @@ export class EntityGroupsTableConfig extends EntityTableConfig $event.stopPropagation(); } let ownerId = this.userPermissionsService.getUserOwnerId(); - if (this.params.customerId) { + if (this.edgeOwnerId && this.authUser.authority === Authority.TENANT_ADMIN) { + // List groups of the edge owner and its parent owners, so the groups of the customer that owns the edge are + // available no matter which page the edge was opened from (Edge management or Customers). + // Tenant admin only: for a customer user the edge owner may be outside their owner chain (an edge shared + // from the tenant or a parent customer), and the hierarchy request is then denied + ownerId = this.edgeOwnerId; + } else if (this.params.customerId) { ownerId = { id: this.params.customerId, entityType: EntityType.CUSTOMER