RoleController: Include domain of a domain-aware backend..

..when suggesting user names of it
This commit is contained in:
Johannes Meyer 2022-06-13 14:49:36 +02:00
parent d663fe84c3
commit e050ea53ee
1 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@ use GuzzleHttp\Psr7\ServerRequest;
use Icinga\Authentication\AdmissionLoader;
use Icinga\Authentication\Auth;
use Icinga\Authentication\RolesConfig;
use Icinga\Authentication\User\DomainAwareInterface;
use Icinga\Data\Selectable;
use Icinga\Exception\NotFoundError;
use Icinga\Forms\Security\RoleForm;
@ -274,9 +275,14 @@ class RoleController extends AuthBackendController
continue;
}
$domain = '';
if ($backend instanceof DomainAwareInterface) {
$domain = '@' . $backend->getDomain();
}
$users = [];
foreach ($names as $name) {
$users[] = [$name, [
$users[] = [$name . $domain, [
'type' => 'user',
'backend' => $backend->getName()
]];