Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Granular before filters for sinatra

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 sinatra-any.gemspec
README.md

Synopsis

Granular before filters for Sinatra

Install

gem install sinatra-any

Use

require 'sinatra'
require 'sinatra/any'

any "/api/v2/*" do
  halt 403 if unauthorized?
end

get "/api/v2/widgets" do
  do_somthing_for_authorized_users
end

Thanks

@jbarnette (John Barnette) for convicing me this is a real problem
to solve because Rails can't follow specs.
Something went wrong with that request. Please try again.