public function preflighted(): bool
    {

        // Just stop if ESI is considered down.
        if ($this->isEsiDown()) return false;

        // Ignore NPC corporations by marking the job as unauthenticated.
        // This is admittedly a little hacky, so a better way is needed
        // more long term.
        if (in_array('corporation', $this->tags()) && $this->isNPCCorporation())
            return false;

        // Public endpoints need no checking
        if ($this->isPublicEndpoint()) return true;

        // Check if the current scope also needs a corp role. If it does,
        // ensure that the current character also has the required role
        // and the corporation is not an NPC corporation.
        if (count($this->roles) > 0) {

            // Don't process NPC corporations.
            if ($this->isNPCCorporation()) return false;

            // Ensure that the character has the needed roles to make
            // a call to this endpoint.
            if ($this->isCorpCharacterWithRoles())
                return true;
            else
                return false;
        }

        // If a corporation role is *not* required, check that we have the required
        // scope at least.
        if (in_array($this->scope, $this->token->scopes))
            return true;

        // Log the deny
        Log::debug('Denied call to ' . $this->endpoint . ' as scope ' . $this->scope . ' was missing.');

        return false;
    }