fix sponsor test, fixes from rebase, remove admin area check from application controller, fix admin menu layout

This commit is contained in:
Stella Rouzi 2014-08-14 11:37:30 +03:00
parent 17ebad413e
commit ba6643a394
4 changed files with 17 additions and 26 deletions

View file

@ -3,7 +3,6 @@ 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?
@ -34,16 +33,6 @@ class ApplicationController < ActionController::Base
@conferences =Conference.all
end
def verify_user_admin
if self.class.to_s.split('::').first == 'Admin' && verify_user
unless (current_user.has_role? :organizer, :any) || (current_user.has_role? :cfp, :any) ||
(current_user.has_role? :info_desk, :any) ||
(current_user.has_role? :volunteers_coordinator, :any) || current_user.is_admin
raise CanCan::AccessDenied.new('You are not authorized to access this area!')
end
end
end
def verify_user
:authenticate_user!