diff options
author | Toon Claes <toon@gitlab.com> | 2017-04-25 14:44:40 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-04-27 13:29:23 +0200 |
commit | 69f584edb4738d4de82f0301bb2ac8f6b3998814 (patch) | |
tree | 88a323c7a85c2b1625d00012d392034c2ccebd11 /app | |
parent | 025b04f3e7976ac8829e24fcb587d86574b0037d (diff) | |
download | gitlab-ce-69f584edb4738d4de82f0301bb2ac8f6b3998814.tar.gz |
Make namespace owner master of project upon creationtc-make-user-master-project-by-admin
When an admin creates a project in the namespace of a user, that user
automatically gains master access to that project.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/projects/create_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 7828c5806b0..535d93385e6 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -97,7 +97,8 @@ module Projects system_hook_service.execute_hooks_for(@project, :create) unless @project.group || @project.gitlab_project_import? - @project.team << [current_user, :master, current_user] + owners = [current_user, @project.namespace.owner].compact.uniq + @project.add_master(owners, current_user: current_user) end @project.group&.refresh_members_authorized_projects |