diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index da72a194..33ee425c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,11 +12,6 @@ class ApplicationController < ActionController::Base #all token authentication must be done here #response format must be set to JSON - rescue_from CanCan::AccessDenied do |exception| - flash[:warning] = exception.message - redirect_to root_path - end - def set_locale I18n.locale = params[:locale] || I18n.default_locale end @@ -72,6 +67,11 @@ class ApplicationController < ActionController::Base @default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup end + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end + def current_user @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] end diff --git a/app/views/layouts/_left_sidebar.html.erb b/app/views/layouts/_left_sidebar.html.erb index 9af8fcac..aaa89fc9 100644 --- a/app/views/layouts/_left_sidebar.html.erb +++ b/app/views/layouts/_left_sidebar.html.erb @@ -28,41 +28,41 @@