agent foundation
This commit is contained in:
@@ -25,6 +25,7 @@ class UserAccountService
|
||||
|
||||
public function listPaged(array $options): array
|
||||
{
|
||||
// Users with global tenant scope see all tenants — remove the filter so the query isn't restricted.
|
||||
if (!empty($options['tenantUserId'])) {
|
||||
$tenantUserId = (int) $options['tenantUserId'];
|
||||
if ($tenantUserId > 0 && $this->scopeGateway->hasGlobalAccess($tenantUserId)) {
|
||||
@@ -704,6 +705,7 @@ class UserAccountService
|
||||
if ($primaryTenantId === 0 && count($tenantIds) > 1) {
|
||||
return [0, [t('Please select a primary tenant')]];
|
||||
}
|
||||
// Single tenant assigned → auto-select it as primary to avoid requiring the user to pick.
|
||||
if ($primaryTenantId === 0 && count($tenantIds) === 1) {
|
||||
return [(int) $tenantIds[0], []];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user