diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d998974..f831f46 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,7 @@ class ApplicationController < ActionController::Base before_filter :authenticated - helper_method :current_user + helper_method :current_user, :is_admin? # Our security guy keep talking about sea-surfing, cool story bro. # protect_from_forgery @@ -16,4 +16,15 @@ class ApplicationController < ActionController::Base redirect_to root_url and reset_session if not current_user end + def is_admin? + admin = current_user.admin if current_user + end + + def administrative + if not is_admin? + reset_session + redirect_to login_path + end + end + end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 8d5138f..854e375 100755 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,5 @@ class DashboardController < ApplicationController - + def home end