feat: pending roles from crm to be confirmed by superadmins
This commit is contained in:
@@ -31,16 +31,18 @@ class UserRepository extends ServiceEntityRepository
|
||||
{
|
||||
$qb = $this->createQueryBuilder('u');
|
||||
|
||||
// administrative roles, plus the pending markers standing in for them
|
||||
$roles = [...array_keys(User::PENDING_ROLES), ...array_values(User::PENDING_ROLES)];
|
||||
|
||||
foreach ($roles as $index => $role) {
|
||||
$qb
|
||||
->orWhere('JSON_CONTAINS(u.roles, :role'.$index.') = 1')
|
||||
->setParameter('role'.$index, json_encode($role))
|
||||
;
|
||||
}
|
||||
|
||||
return $qb
|
||||
->where('JSON_CONTAINS(u.roles, :role_admin) = 1')
|
||||
->orWhere('JSON_CONTAINS(u.roles, :role_manager) = 1')
|
||||
->orWhere('JSON_CONTAINS(u.roles, :role_house_manager) = 1')
|
||||
->orderBy('u.lastName', 'ASC')
|
||||
->setParameters([
|
||||
'role_admin' => json_encode('ROLE_ADMIN'),
|
||||
'role_manager' => json_encode('ROLE_MANAGER'),
|
||||
'role_house_manager' => json_encode('ROLE_HOUSE_MANAGER'),
|
||||
])
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user