1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 07:41:22 +02:00

Always allow users to see their own account. fixes #1626

This commit is contained in:
Toby Zerner
2018-11-11 14:25:21 +10:30
parent ebcc173496
commit b68f183e86

View File

@@ -39,7 +39,11 @@ class UserPolicy extends AbstractPolicy
public function find(User $actor, Builder $query) public function find(User $actor, Builder $query)
{ {
if ($actor->cannot('viewUserList')) { if ($actor->cannot('viewUserList')) {
if ($actor->isGuest()) {
$query->whereRaw('FALSE'); $query->whereRaw('FALSE');
} else {
$query->where('id', $actor->id);
}
} }
} }
} }