summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-08-25 16:21:27 +0100
committerNick Thomas <nick@gitlab.com>2017-08-25 16:21:27 +0100
commit66e18a128498d6f3fab193a80c6b4f45f2c3d7fc (patch)
tree12642133cd8ec63b7c9e81a822fa577e81f246fb /app/services
parent8b73df0cf534797bff9ce0f5b95af5347ea59ca6 (diff)
downloadgitlab-ce-66e18a128498d6f3fab193a80c6b4f45f2c3d7fc.tar.gz
Don't add admins as masters to projects created in another user's namespace
Only admins have the ability to create a project in another user's personal namespace. Prior to this commit, we were explicitly adding them as masters to the project. However, admins already have access (by virture of being admins), so this is unnecessary.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/projects/create_service.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 0d6066b70c7..68e592d79c3 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -112,8 +112,7 @@ module Projects
if group || @project.gitlab_project_import?
current_user.refresh_authorized_projects
else
- owners = [current_user, @project.namespace.owner].compact.uniq
- @project.add_master(owners, current_user: current_user)
+ @project.add_master(@project.namespace.owner, current_user: current_user)
end
end