public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
class Ability
include CanCan::Ability
def initialize(user)
if user.beta_approved
can :view, :site
end
end
end
 
class ApplicationController < ActionController::Base
 
before_filter :check_permissions
def check_permissions
redirect_to root_path unless can?(:view, :site)
end
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.