mirror of
https://github.com/flarum/core.git
synced 2025-10-15 00:44:40 +02:00
Enforce forum.view permission
This commit is contained in:
@@ -14,6 +14,10 @@ trait VisibleScope
|
||||
*/
|
||||
public function scopeWhereVisibleTo(Builder $query, User $actor)
|
||||
{
|
||||
event(new ScopeModelVisibility($this, $query, $actor));
|
||||
if (! app('flarum.forum')->can($actor, 'view')) {
|
||||
$query->whereRaw('FALSE');
|
||||
} else {
|
||||
event(new ScopeModelVisibility($this, $query, $actor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user