feat: selectable feedback author for administrative users

addresses #869at5nbp
This commit is contained in:
Björn Fromme
2026-08-24 12:46:19 +02:00
parent 4ae23bf8a1
commit 43968e4e7b
9 changed files with 218 additions and 179 deletions
+29
View File
@@ -61,6 +61,35 @@ class UserRepository extends ServiceEntityRepository
;
}
/**
* Active users holding at least one of the given roles.
*
* @param string[] $roles
*
* @return User[]
*/
public function getUsersByRoles(array $roles): array
{
$qb = $this->createQueryBuilder('user');
$roleMatches = $qb->expr()->orX();
foreach ($roles as $index => $role) {
$roleMatches->add('JSON_CONTAINS(user.roles, :role_'.$index.') = 1');
$qb->setParameter('role_'.$index, json_encode($role));
}
return $qb
->andWhere($roleMatches)
->andWhere($qb->expr()->isNull('user.deletedAt'))
->andWhere($qb->expr()->isNull('user.disabledAt'))
->orderBy('user.lastName', 'ASC')
->addOrderBy('user.firstName', 'ASC')
->getQuery()
->getResult()
;
}
/**
* @param string[]|string $hotelCode
*