diff --git a/src/Controllers/UserController.php b/src/Controllers/UserController.php index 63204d38..9529c92f 100644 --- a/src/Controllers/UserController.php +++ b/src/Controllers/UserController.php @@ -55,7 +55,8 @@ final class UserController extends AbstractController public function getByNameOrEmail($userNameOrEmail) { - $this->privilegeService->assertPrivilege(Privilege::VIEW_USERS); + if (!$this->privilegeService->isLoggedIn($userNameOrEmail)) + $this->privilegeService->assertPrivilege(Privilege::VIEW_USERS); $user = $this->userService->getByNameOrEmail($userNameOrEmail); return $this->userViewProxy->fromEntity($user); }