Jacwright\RestServer\RestServer::unauthorized PHP Method

unauthorized() public method

public unauthorized ( $ask = false )
    public function unauthorized($ask = false)
    {
        if ($ask) {
            header("WWW-Authenticate: Basic realm=\"{$this->realm}\"");
        }
        throw new RestException(401, "You are not authorized to access this resource.");
    }