mirror of
https://github.com/flarum/framework.git
synced 2025-04-02 23:19:04 +08:00
Removes AssertPermissionTrait (#17)
* Removes AssertPermissionTrait * Fix my dumb mistake
This commit is contained in:
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user