Removes AssertPermissionTrait (#20)

* Removes AssertPermissionTrait

* Fix my dumb mistake
This commit is contained in:
Matt Kilgore 2020-07-20 01:58:22 -04:00 committed by GitHub
parent 27925133d6
commit e8490bd991

View File

@ -13,13 +13,10 @@ use Flarum\Likes\Event\PostWasLiked;
use Flarum\Likes\Event\PostWasUnliked;
use Flarum\Post\Event\Deleted;
use Flarum\Post\Event\Saving;
use Flarum\User\AssertPermissionTrait;
use Illuminate\Contracts\Events\Dispatcher;
class SaveLikesToDatabase
{
use AssertPermissionTrait;
/**
* @param Dispatcher $events
*/
@ -41,7 +38,7 @@ class SaveLikesToDatabase
$actor = $event->actor;
$liked = (bool) $data['attributes']['isLiked'];
$this->assertCan($actor, 'like', $post);
$actor->assertCan('like', $post);
$currentlyLiked = $post->likes()->where('user_id', $actor->id)->exists();