From b92ae61294cbd0b01388ac8af1cb7698256af219 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Nov 2018 14:25:21 +1030 Subject: [PATCH] Always allow users to see their own account. fixes #1626 --- src/User/UserPolicy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/User/UserPolicy.php b/src/User/UserPolicy.php index 8a37720e4..0a33b012a 100644 --- a/src/User/UserPolicy.php +++ b/src/User/UserPolicy.php @@ -39,7 +39,11 @@ class UserPolicy extends AbstractPolicy public function find(User $actor, Builder $query) { if ($actor->cannot('viewUserList')) { - $query->whereRaw('FALSE'); + if ($actor->isGuest()) { + $query->whereRaw('FALSE'); + } else { + $query->where('id', $actor->id); + } } } }