diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-21 16:40:46 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-21 19:06:41 +0200 |
commit | 8ffef5ecaff3bad2d86c313ae9b00f86ab7a7dfc (patch) | |
tree | 2ec0076566252492cf1e2049bbfefa034860bed2 /lib/api/projects.rb | |
parent | b3efa39762336ffd0ed36a79be515cac368f5591 (diff) | |
download | gitlab-ce-22417-api-fork-fix.tar.gz |
API: Return 404 when trying to fork to unaccessible namespace22417-api-fork-fix
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 5eb83c2c8f8..6d99617b56f 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -207,7 +207,9 @@ module API if namespace_id.present? namespace = Namespace.find_by(id: namespace_id) || Namespace.find_by_path_or_name(namespace_id) - not_found!('Target Namespace') unless namespace + unless namespace && can?(current_user, :create_projects, namespace) + not_found!('Target Namespace') + end attrs[:namespace] = namespace end |