Removes AssertPermissionTrait (#25)

* Removes AssertPermissionTrait

* Fix ->can to ->assertCan
This commit is contained in:
Matt Kilgore 2020-07-19 17:37:14 -04:00 committed by GitHub
parent 6fc7ba196b
commit d90d0e5fbc

View File

@ -13,14 +13,11 @@ use DateTime;
use Flarum\Suspend\Event\Suspended;
use Flarum\Suspend\Event\Unsuspended;
use Flarum\Suspend\SuspendValidator;
use Flarum\User\AssertPermissionTrait;
use Flarum\User\Event\Saving;
use Illuminate\Contracts\Events\Dispatcher;
class SaveSuspensionToDatabase
{
use AssertPermissionTrait;
/**
* Validator for limited suspension.
*
@ -53,7 +50,7 @@ class SaveSuspensionToDatabase
$user = $event->user;
$actor = $event->actor;
$this->assertCan($actor, 'suspend', $user);
$actor->assertCan('suspend', $user);
$user->suspended_until = $attributes['suspendedUntil']
? new DateTime($attributes['suspendedUntil'])