mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 06:04:15 +08:00
Always allow users to see their own account. fixes #1626
This commit is contained in:
parent
ebcc173496
commit
b68f183e86
@ -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