From 023eff95e31b0f1333ad28a4b77908cb1f82a2d4 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 5 Aug 2015 18:12:09 +0930 Subject: [PATCH] Let users see themselves even if they can't see the forum --- src/Core/Support/VisibleScope.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Core/Support/VisibleScope.php b/src/Core/Support/VisibleScope.php index 00f6135d5..dec71b2bf 100644 --- a/src/Core/Support/VisibleScope.php +++ b/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)); }