Merge pull request #15 from flarum/tz/1419-restrict-own-permissions

Remove obsolete permission logic
This commit is contained in:
Toby Zerner 2018-09-22 12:22:22 +09:30 committed by GitHub
commit c66897fd92
2 changed files with 0 additions and 38 deletions

View File

@ -29,6 +29,5 @@ return [
$events->subscribe(Listener\SaveLockedToDatabase::class);
$events->subscribe(Access\DiscussionPolicy::class);
$events->subscribe(Access\PostPolicy::class);
},
];

View File

@ -1,37 +0,0 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Lock\Access;
use Flarum\Post\Post;
use Flarum\User\AbstractPolicy;
use Flarum\User\User;
class PostPolicy extends AbstractPolicy
{
/**
* {@inheritdoc}
*/
protected $model = Post::class;
/**
* @param User $actor
* @param Post $post
* @return bool
*/
public function edit(User $actor, Post $post)
{
$discussion = $post->discussion;
if ($discussion->is_locked && $actor->cannot('lock', $discussion)) {
return false;
}
}
}