mirror of
https://github.com/flarum/core.git
synced 2025-10-13 07:54:25 +02:00
Model Visibility Scoping Extender and Tests (#2460)
This commit is contained in:
committed by
GitHub
parent
e0437d237a
commit
8901073d12
@@ -11,7 +11,6 @@ namespace Flarum\Notification;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Flarum\Database\AbstractModel;
|
||||
use Flarum\Event\ScopeModelVisibility;
|
||||
use Flarum\Notification\Blueprint\BlueprintInterface;
|
||||
use Flarum\User\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -161,9 +160,9 @@ class Notification extends AbstractModel
|
||||
->from((new $class)->getTable())
|
||||
->whereColumn('id', 'subject_id');
|
||||
|
||||
static::$dispatcher->dispatch(
|
||||
new ScopeModelVisibility($class::query()->setQuery($query), $actor, 'view')
|
||||
);
|
||||
if (method_exists($class, 'registerVisibilityScoper')) {
|
||||
$class::query()->setQuery($query)->whereVisibleTo($actor);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user