mirror of
https://github.com/flarum/framework.git
synced 2025-02-23 07:05:26 +08:00
Always allow users to see their own account. fixes #1626
This commit is contained in:
parent
e99f7fcdac
commit
b92ae61294
@ -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')) {
|
||||||
$query->whereRaw('FALSE');
|
if ($actor->isGuest()) {
|
||||||
|
$query->whereRaw('FALSE');
|
||||||
|
} else {
|
||||||
|
$query->where('id', $actor->id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user