Commit 3877f9e1 authored by Arturo Herrero's avatar Arturo Herrero

Fix JIRA DVCS retrieving repositories

Retrieving repositories from personal namespace on GitLab.com results in
an error. This is a regression introduced in f755a5ff.

The intent was to return all projects for instance admins but we don't
need to include public projects for regular users.
parent 1286985c
---
title: Fix JIRA DVCS retrieving repositories
merge_request: 23180
author:
type: fixed
...@@ -117,8 +117,8 @@ module API ...@@ -117,8 +117,8 @@ module API
namespace = Namespace.find_by_full_path(params[:namespace]) namespace = Namespace.find_by_full_path(params[:namespace])
not_found!('Namespace') unless namespace && licensed?(namespace) not_found!('Namespace') unless namespace && licensed?(namespace)
projects = Project.public_or_visible_to_user(current_user) projects = current_user.can_read_all_resources? ? Project.all : current_user.authorized_projects
.in_namespace(namespace.self_and_descendants) projects = projects.in_namespace(namespace.self_and_descendants)
.eager_load_namespace_and_owner .eager_load_namespace_and_owner
.with_route .with_route
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment