I-Iugo / sinatra-pundit

Pundit authorization wrapper for Sinatra

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sinatra::Pundit

Gem Version

A lightweight wrapper for the Pundit authorization gem. Provides authorization Pundit's helpers to use in Sinatra applications.

Installation

Add this line to your application's Gemfile:

gem 'sinatra-pundit'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sinatra-pundit

Usage

Require the extension in your application:

require 'sinatra/pundit'

If your application is “classic”, you’re done. The authorize method should be available to your application.

If your application subclasses Sinatra::Base, you have to register the extension in your subclass:

register Sinatra::Pundit

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/smartinm/sinatra-pundit.

License

The gem is available as open source under the terms of the MIT License.

About

Pundit authorization wrapper for Sinatra

License:MIT License


Languages

Language:Ruby 100.0%