From 3ae01ee4e82aeb2e650c402c4c7081d5197843c8 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 12 Oct 2014 11:45:42 +0200 Subject: [PATCH] Fixed restricted user unable to view his profile --- src/Controllers/UserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }