App\Libraries\OsuAuthorize::checkForumPostEdit PHP Method

checkForumPostEdit() public method

public checkForumPostEdit ( $user, $post )
    public function checkForumPostEdit($user, $post)
    {
        $prefix = 'forum.post.edit.';
        $this->ensureLoggedIn($user);
        $this->ensureCleanRecord($user);
        if ($user->isGMT()) {
            return 'ok';
        }
        if (!$this->doCheckUser($user, 'ForumView', $post->topic->forum)->can()) {
            return $prefix . 'no_forum_access';
        }
        if ($post->poster_id !== $user->user_id) {
            return $prefix . 'not_owner';
        }
        if ($post->topic->isLocked()) {
            return $prefix . 'topic_locked';
        }
        if ($post->post_edit_locked) {
            return $prefix . 'locked';
        }
        return 'ok';
    }