refactor projects API
This commit is contained in:
parent
0a6b64e6a9
commit
0f604e62fb
3 changed files with 13 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue