Added method to determine current acter (group or user)

This commit is contained in:
George Vinogradov 2011-10-17 18:16:21 +04:00
parent fa3359b025
commit ff5aa09c30
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,12 @@ class ApplicationController < ActionController::Base
end
end
def get_acter
return User.find params[:user_id] if params[:user_id]
return Group.find params[:group_id] if params[:group_id]
return current_user
end
def authenticate_build_service!
if request.remote_ip != APP_CONFIG['build_service_ip']
render :nothing => true, :status => 403