agent foundation
This commit is contained in:
@@ -222,6 +222,7 @@ class AddressBookService
|
||||
return ['status' => 'not_found'];
|
||||
}
|
||||
|
||||
// Users can always view their own profile; others require scope access.
|
||||
if (
|
||||
$currentUserId !== $targetUserId
|
||||
&& !$this->directoryGateway->canAccessUser($currentUserId, $targetUserId)
|
||||
@@ -239,6 +240,7 @@ class AddressBookService
|
||||
}
|
||||
$tenantId = (int) ($department['tenant_id'] ?? 0);
|
||||
$label = trim((string) ($department['description'] ?? ''));
|
||||
// Only show departments in tenants the viewer also belongs to — prevents leaking org structure.
|
||||
if ($tenantId <= 0 || $label === '' || !in_array($tenantId, $viewerTenantIds, true)) {
|
||||
continue;
|
||||
}
|
||||
@@ -327,6 +329,7 @@ class AddressBookService
|
||||
return array_values(array_filter($ids, static fn (int $id): bool => $id > 0));
|
||||
}
|
||||
|
||||
// Accepts either a '||'-delimited DB aggregate string (from GROUP_CONCAT) or a plain array.
|
||||
private function normalizeLabelList($value): array
|
||||
{
|
||||
if (is_string($value)) {
|
||||
|
||||
Reference in New Issue
Block a user