* Admins also do not need permission to edit their posts

This commit is contained in:
Visman 2018-11-05 20:41:42 +07:00
parent c3fbf44502
commit 58a39ccc48
3 changed files with 3 additions and 3 deletions

View file

@ -33,7 +33,7 @@ class Edit extends Page
$this->c->Lang->load('post');
if ($method === 'POST') {
$v = $this->messageValidator($topic, 'EditPost', $args, true, $editSubject);
$v = $this->messageValidator($post, 'EditPost', $args, true, $editSubject);
if ($v->validation($_POST) && null === $v->preview) {
return $this->endEdit($post, $v);

View file

@ -124,7 +124,7 @@ trait PostFormTrait
'checked' => isset($vars['merge_post']) ? (bool) $vars['merge_post'] : true,
];
}
if ($editPost && ! $model->user->isGuest) {
if ($editPost && ! $model->user->isGuest && ! $model->user->isAdmin) {
$fieldset['edit_post'] = [
'type' => 'checkbox',
'label' => \ForkBB\__('EditPost edit'),

View file

@ -120,7 +120,7 @@ trait PostValidatorTrait
} else {
$ruleMergePost = 'absent';
}
if ($editPost) {
if ($editPost && ! $model->user->isGuest && ! $model->user->isAdmin) {
$ruleEditPost = 'checkbox';
} else {
$ruleEditPost = 'absent';