Flarum\Core\Access\PostPolicy::edit PHP Метод

edit() публичный Метод

public edit ( User $actor, Post $post ) : boolean | null
$actor Flarum\Core\User
$post Flarum\Core\Post
Результат boolean | null
    public function edit(User $actor, Post $post)
    {
        // A post is allowed to be edited if the user has permission to moderate
        // the discussion which it's in, or if they are the author and the post
        // hasn't been deleted by someone else.
        if ($post->user_id == $actor->id && (!$post->hide_time || $post->hide_user_id == $actor->id)) {
            $allowEditing = $this->settings->get('allow_post_editing');
            if ($allowEditing === '-1' || $allowEditing === 'reply' && $post->number >= $post->discussion->last_post_number || $post->time->diffInMinutes(new Carbon()) < $allowEditing) {
                return true;
            }
        }
    }