summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api.rb b/lib/api.rb
index ab5b02e0556..4fdc3273a0e 100644
--- a/lib/api.rb
+++ b/lib/api.rb
@@ -41,19 +41,19 @@ module Gitlab
# GET /projects/:id
get ":id" do
- @project = Project.find_by_code(params[:id])
+ @project = current_user.projects.find_by_code(params[:id])
present @project, :with => Entities::Project
end
# GET /projects/:id/repository/branches
get ":id/repository/branches" do
- @project = Project.find_by_code(params[:id])
+ @project = current_user.projects.find_by_code(params[:id])
present @project.repo.heads.sort_by(&:name), :with => Entities::ProjectRepositoryBranches
end
# GET /projects/:id/repository/tags
get ":id/repository/tags" do
- @project = Project.find_by_code(params[:id])
+ @project = current_user.projects.find_by_code(params[:id])
present @project.repo.tags.sort_by(&:name).reverse, :with => Entities::ProjectRepositoryTags
end
end