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

Make "own" permissions depend on the user's ability to reply
This commit is contained in:
Toby Zerner 2018-09-22 12:22:17 +09:30 committed by GitHub
commit b0a2482c87

View File

@ -120,7 +120,7 @@ class DiscussionPolicy extends AbstractPolicy
*/
public function tag(User $actor, Discussion $discussion)
{
if ($discussion->user_id == $actor->id) {
if ($discussion->user_id == $actor->id && $actor->can('reply', $discussion)) {
$allowEditTags = $this->settings->get('allow_tag_change');
if ($allowEditTags === '-1'