summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-07-06 06:08:17 -0700
committerNihad Abbasov <narkoz.2008@gmail.com>2012-07-06 06:36:43 -0700
commit0f604e62fb453f2359ebc0438fe7dfaff8e55d10 (patch)
treea2323b59a343b53084d0708dd372e17e2286b208 /lib/api/helpers.rb
parent0a6b64e6a9c5858801a7af2c408416b1c98de471 (diff)
downloadgitlab-ce-0f604e62fb453f2359ebc0438fe7dfaff8e55d10.tar.gz
refactor projects API
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 424a17b283c..e7b9a417b08 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -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