App\Libraries\OsuAuthorize::checkForumTopicReply PHP Method

checkForumTopicReply() public method

public checkForumTopicReply ( $user, $topic )
    public function checkForumTopicReply($user, $topic)
    {
        $prefix = 'forum.topic.reply.';
        $this->ensureLoggedIn($user, $prefix . 'user.');
        $this->ensureCleanRecord($user, $prefix . 'user.');
        if ($user->isGMT()) {
            return 'ok';
        }
        if (!$this->doCheckUser($user, 'ForumView', $topic->forum)->can()) {
            return $prefix . 'no_forum_access';
        }
        if (!ForumAuthorize::aclCheck($user, 'f_reply', $topic->forum)) {
            return $prefix . 'no_permission';
        }
        if ($topic->isLocked()) {
            return $prefix . 'locked';
        }
        if ($topic->isDoublePostBy($user)) {
            return $prefix . 'double_post';
        }
        return 'ok';
    }