verify user if accessing admin area. Testing: setup organizer_conference_1_role

This commit is contained in:
Stella Rouzi 2014-07-18 20:49:50 +03:00
parent ab17e6db11
commit 940f76bf13
22 changed files with 91 additions and 62 deletions

View file

@ -3,6 +3,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :get_conferences
before_filter :store_location
before_filter :verify_user_admin
helper_method :date_string
# Ensure every controller authorizes resource or skips authorization (skip_authorization_check)
check_authorization unless: :devise_controller?
@ -33,6 +34,12 @@ class ApplicationController < ActionController::Base
@conferences =Conference.all
end
def verify_user_admin
if self.class.to_s.split('::').first == 'Admin'
verify_user
end
end
def verify_user
:authenticate_user!