Commit 6d92aa6d authored by randx's avatar randx

Fix IssueObserver current_user assign. Refactored observers

parent 55f83385
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :reject_blocked! before_filter :reject_blocked!
before_filter :set_current_user_for_mailer, :check_token_auth before_filter :set_current_user_for_mailer
before_filter :check_token_auth
before_filter :set_current_user_for_observers
protect_from_forgery protect_from_forgery
helper_method :abilities, :can? helper_method :abilities, :can?
rescue_from Gitlab::Gitolite::AccessDenied do |exception| rescue_from Gitlab::Gitolite::AccessDenied do |exception|
...@@ -58,6 +62,10 @@ class ApplicationController < ActionController::Base ...@@ -58,6 +62,10 @@ class ApplicationController < ActionController::Base
MailerObserver.current_user = current_user MailerObserver.current_user = current_user
end end
def set_current_user_for_observers
IssueObserver.current_user = current_user
end
def abilities def abilities
@abilities ||= Six.new @abilities ||= Six.new
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment