we are going to fix this by automatically generating data for ppl that register HOWEVER, just in case that fails for some reason, I have applied a filter that ensures if some data is not associated with a person they cannot navigate to all aspects of the application. This is a preventive measure

This commit is contained in:
Ken Johnson
2013-05-31 19:02:00 -04:00
parent c63275b3b3
commit 6199beb780
8 changed files with 26 additions and 3 deletions
+15 -1
View File
@@ -1,6 +1,6 @@
class ApplicationController < ActionController::Base
before_filter :authenticated
before_filter :authenticated, :has_info
helper_method :current_user, :is_admin?
# Our security guy keep talking about sea-surfing, cool story bro.
@@ -27,4 +27,18 @@ class ApplicationController < ActionController::Base
end
end
def has_info
redirect = false
if current_user
begin
if !(current_user.retirement || current_user.paid_time_off.schedule || current_user.paid_time_off || current_user.work_info || current_user.performance)
redirect = true
end
rescue
redirect = true
end
end
redirect_to home_dashboard_index_path if redirect
end
end