mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
Remove obsolete permission logic
flarum/core#1513 changes the post.edit permission so that it is only granted if the user also has permission to reply to the discussion. This means that explicitly revoking the edit permission is no longer necessary, as it will never be granted in the first place.
This commit is contained in:
@@ -29,6 +29,5 @@ return [
|
||||
$events->subscribe(Listener\SaveLockedToDatabase::class);
|
||||
|
||||
$events->subscribe(Access\DiscussionPolicy::class);
|
||||
$events->subscribe(Access\PostPolicy::class);
|
||||
},
|
||||
];
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user