Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UsersController < ApplicationController
- before_filter :check_allowed_role, :only => [:index, :destroy, :enable, :show]
- ....
- #login_system.rb
- def check_allowed_role
- unless is_logged_in? && (@logged_in_user.has_role?('Administrator') || @logged_in_user.has_role?('Support'))
- flash[:error] = "You do not have the permission to do that."
- redirect_to :controller => 'account', :action => 'login'
- end
- end
Add Comment
Please, Sign In to add comment