Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 beta.gemspec
README.md

Beta Build Status

Beta is an access control library that uses a Redis whitelist to control authorization. It relies upon the Rails.env variable to check against its list of environments to trigger on.

Install

Install with gem install beta or add gem 'beta' to your Gemfile.

Then, add an initializer in your Rails application to configure Beta:

Beta.config do |config|
  redis = $redis
  uid = 'mlg_id'
  namespace    = 'awesome-app'
  redirect_url = 'http://majorleaguegaming.com'
  environments = [:production]
end

Finally, Beta requires the existence of a current_user which responds to the attribute specified in the uid configuration key used in both the whitelist and current_user_on_whitelist? methods.

Usage

By adding include Beta::AccesHelpers to ApplicationController, you get access to the following methods:

  • whitelist - Used as a before_filter to ensure the current_user has access
  • is_whitelisted?(user) checks to see if the given user is on the list.
  • current_user_on_whitelist? leverages is_whitelisted? to tell you if the current user is special.
Something went wrong with that request. Please try again.