mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Let users see themselves even if they can't see the forum
This commit is contained in:
parent
ff8dc5ef25
commit
023eff95e3
|
@ -15,7 +15,11 @@ trait VisibleScope
|
|||
public function scopeWhereVisibleTo(Builder $query, User $actor)
|
||||
{
|
||||
if (! app('flarum.forum')->can($actor, 'view')) {
|
||||
$query->whereRaw('FALSE');
|
||||
if ($this instanceof User) {
|
||||
$query->where('id', $actor->id);
|
||||
} else {
|
||||
$query->whereRaw('FALSE');
|
||||
}
|
||||
} else {
|
||||
event(new ScopeModelVisibility($this, $query, $actor));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user