Removes AssertPermissionTrait ()

* Removes AssertPermissionTrait

* Fix my dumb mistake
This commit is contained in:
Matt Kilgore 2020-07-20 01:59:16 -04:00 committed by GitHub
parent bab0e072b3
commit 38c0e3c500

@ -12,13 +12,10 @@ namespace Flarum\Sticky\Listener;
use Flarum\Discussion\Event\Saving; use Flarum\Discussion\Event\Saving;
use Flarum\Sticky\Event\DiscussionWasStickied; use Flarum\Sticky\Event\DiscussionWasStickied;
use Flarum\Sticky\Event\DiscussionWasUnstickied; use Flarum\Sticky\Event\DiscussionWasUnstickied;
use Flarum\User\AssertPermissionTrait;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class SaveStickyToDatabase class SaveStickyToDatabase
{ {
use AssertPermissionTrait;
/** /**
* @param Dispatcher $events * @param Dispatcher $events
*/ */
@ -37,7 +34,7 @@ class SaveStickyToDatabase
$discussion = $event->discussion; $discussion = $event->discussion;
$actor = $event->actor; $actor = $event->actor;
$this->assertCan($actor, 'sticky', $discussion); $actor->assertCan('sticky', $discussion);
if ((bool) $discussion->is_sticky === $isSticky) { if ((bool) $discussion->is_sticky === $isSticky) {
return; return;