Project

beta

0.0
No commit activity in last 3 years
No release in over 3 years
Gem to handle multiple common cases of beta rollout
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1.0
>= 0
>= 0

Runtime

>= 0
 Project Readme

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.