diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-07-25 01:48:00 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-07-25 01:48:00 -0700 |
commit | b683a71aa1230f17f9df47661c77dfeae27027de (patch) | |
tree | d5370bc067c2bee633cc659e20b490b6be91d7a4 /lib/api/helpers.rb | |
parent | 8b7e404b5b6944e9c92cc270b2e5d0005781d49d (diff) | |
parent | fbb41100db35cf2def2c8b4d896b7015d56bd15b (diff) | |
download | gitlab-ce-b683a71aa1230f17f9df47661c77dfeae27027de.tar.gz |
Merge pull request #1135 from NARKOZ/api
Issues API
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 4 |
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 |