diff --git a/framework/core/src/Core/Support/VisibleScope.php b/framework/core/src/Core/Support/VisibleScope.php index 00f6135d5..dec71b2bf 100644 --- a/framework/core/src/Core/Support/VisibleScope.php +++ b/framework/core/src/Core/Support/VisibleScope.php @@ -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)); }