feat: assignable managers for accommodation bookings

This commit is contained in:
Björn Fromme
2026-08-05 13:45:33 +02:00
parent 8e4afc0813
commit 736128476b
9 changed files with 247 additions and 1 deletions
+18
View File
@@ -17,4 +17,22 @@ class UserRepository extends ServiceEntityRepository
{
parent::__construct($registry, User::class);
}
/**
* Users who can look after a group booking. The roles are a JSON array column and no
* JSON_CONTAINS is registered, so the needles carry their quotes to stay anchored to
* whole array entries. Only the literal roles count — a plain ROLE_ADMIN is not offered.
*
* @return User[]
*/
public function findGroupsStaff(): array
{
return $this->createQueryBuilder('u')
->andWhere('u.roles LIKE :groupsAdmin OR u.roles LIKE :groupsManager')
->setParameter('groupsAdmin', '%"ROLE_GROUPS_ADMIN"%')
->setParameter('groupsManager', '%"ROLE_GROUPS_MANAGER"%')
->orderBy('u.email', 'ASC')
->getQuery()
->getResult();
}
}