mirror of
https://github.com/flarum/framework.git
synced 2025-06-04 14:54:32 +08:00
Fix bug in permission logic
This commit is contained in:
@ -32,8 +32,9 @@ class UnapproveNewContent
|
||||
$post = $event->post;
|
||||
|
||||
if (! $post->exists) {
|
||||
if (($post->discussion->number_index == 0 && $event->actor->can('startWithoutApproval', $post->discussion))
|
||||
|| $event->actor->can('replyWithoutApproval', $post->discussion)) {
|
||||
$ability = $post->discussion->number_index == 0 ? 'startWithoutApproval' : 'replyWithoutApproval';
|
||||
|
||||
if ($event->actor->can($ability, $post->discussion)) {
|
||||
if ($post->is_approved === null) {
|
||||
$post->is_approved = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user