mirror of
https://github.com/flarum/core.git
synced 2025-10-13 16:05:05 +02:00
Deprecate AssertPermissionTrait (#2044)
This commit is contained in:
committed by
GitHub
parent
2b3dec2be1
commit
eaac78650f
@@ -12,13 +12,11 @@ namespace Flarum\Post\Command;
|
||||
use Flarum\Foundation\DispatchEventsTrait;
|
||||
use Flarum\Post\Event\Deleting;
|
||||
use Flarum\Post\PostRepository;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class DeletePostHandler
|
||||
{
|
||||
use DispatchEventsTrait;
|
||||
use AssertPermissionTrait;
|
||||
|
||||
/**
|
||||
* @var \Flarum\Post\PostRepository
|
||||
@@ -46,7 +44,7 @@ class DeletePostHandler
|
||||
|
||||
$post = $this->posts->findOrFail($command->postId, $actor);
|
||||
|
||||
$this->assertCan($actor, 'delete', $post);
|
||||
$actor->assertCan('delete', $post);
|
||||
|
||||
$this->events->dispatch(
|
||||
new Deleting($post, $actor, $command->data)
|
||||
|
Reference in New Issue
Block a user