1
0
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:
Alexander Skvortsov
2020-07-17 09:16:15 -04:00
committed by GitHub
parent 2b3dec2be1
commit eaac78650f
36 changed files with 103 additions and 135 deletions

View File

@@ -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)