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