diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-10 03:54:58 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-10 03:54:58 -0700 |
commit | 90d497056fe68593f54886e2d546eaff1315227c (patch) | |
tree | 427d4c62cdddb50623f2ea1975027f59a4f70ac4 /lib/api/helpers.rb | |
parent | d2d566b162b60a2d310dfcdbcd0963c2156dd5ae (diff) | |
parent | ea5a006f27cfd3013f94652e0e0f0e63091036ad (diff) | |
download | gitlab-ce-90d497056fe68593f54886e2d546eaff1315227c.tar.gz |
Merge pull request #4515 from amacarthur/fork-admin
Additon of apis for fork administration.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 94cf4f2e69f..f857d4133b2 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -5,12 +5,12 @@ module API end def user_project - @project ||= find_project + @project ||= find_project(params[:id]) @project || not_found! end - def find_project - project = Project.find_by_id(params[:id]) || Project.find_with_namespace(params[:id]) + def find_project(id) + project = Project.find_by_id(id) || Project.find_with_namespace(id) if project && can?(current_user, :read_project, project) project |