mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 15:33:20 +08:00
Removes AssertPermissionTrait (#25)
* Removes AssertPermissionTrait * Fix ->can to ->assertCan
This commit is contained in:
parent
6fc7ba196b
commit
d90d0e5fbc
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue
Block a user