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
... ...
......
File moved
File moved
File moved
File moved
File moved
File moved