Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created April 6, 2009 23:13
Show Gist options
  • Save bmizerany/90998 to your computer and use it in GitHub Desktop.
Save bmizerany/90998 to your computer and use it in GitHub Desktop.
class MyApp < Sinatra::Default
condition { authorized? }
get '/this_is_protected' do
protected!
end
end
class MyApp < Sinatra::Default
def protected!
pass unless authorized?
end
get '/this_is_protected' do
protected!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment