App\Libraries\OsuAuthorize::checkForumTopicCoverEdit PHP Метод

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

public checkForumTopicCoverEdit ( $user, $cover )
    public function checkForumTopicCoverEdit($user, $cover)
    {
        $prefix = 'forum.topic_cover.edit.';
        $this->ensureLoggedIn($user);
        $this->ensureCleanRecord($user);
        if ($user->isGMT()) {
            return 'ok';
        }
        if ($cover->topic !== null) {
            return $this->checkForumTopicEdit($user, $cover->topic);
        }
        if ($cover->owner() === null) {
            return $prefix . 'uneditable';
        }
        if ($cover->owner()->user_id !== $user->user_id) {
            return $prefix . 'not_owner';
        }
        return 'ok';
    }