refactor
This commit is contained in:
parent
6446eb2ce1
commit
3337b8c001
|
|
@ -39,10 +39,11 @@ class UserController extends AbstractController
|
|||
$usersByOrganization = $entityManager->getRepository(UsersOrganizations::class)->getActiveUsersGroupedByOrganization();
|
||||
|
||||
} else{
|
||||
$userIdentifier = $this->getUser()->getUserIdentifier();
|
||||
if (!$userIdentifier) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
$user = $this->getUser();
|
||||
if (!$user) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$userIdentifier = $user->getUserIdentifier();
|
||||
$organizations = $this->entityManager->getRepository(UsersOrganizations::class)->findOrganizationsByUserEmailAndRoleName($userIdentifier, 'ADMIN');
|
||||
if(!$organizations) {
|
||||
// if user is not admin in any organization, throw access denied
|
||||
|
|
|
|||
Loading…
Reference in New Issue