refactor projects API

This commit is contained in:
Nihad Abbasov 2012-07-06 06:08:17 -07:00
parent 0a6b64e6a9
commit 0f604e62fb
3 changed files with 13 additions and 21 deletions

View file

@ -4,6 +4,10 @@ module Gitlab
@current_user ||= User.find_by_authentication_token(params[:private_token])
end
def user_project
@project ||= current_user.projects.find_by_code(params[:id])
end
def authenticate!
error!({'message' => '401 Unauthorized'}, 401) unless current_user
end