summaryrefslogtreecommitdiff
path: root/app/models/project_team.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 06:18:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 06:18:49 +0000
commitbf1a77ead789527e185dcf7245f950e53b6a2f90 (patch)
treeb73ab41a7ef3c1e6e938a6f99bffe1d6e3df7f89 /app/models/project_team.rb
parenta9fa13e4ba46e00081cec1f3af332edcd1520785 (diff)
downloadgitlab-ce-bf1a77ead789527e185dcf7245f950e53b6a2f90.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_team.rb')
-rw-r--r--app/models/project_team.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index c3c7508df9f..ee5ecc2dd3c 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -23,6 +23,10 @@ class ProjectTeam
add_user(user, :maintainer, current_user: current_user)
end
+ def add_owner(user, current_user: nil)
+ add_user(user, :owner, current_user: current_user)
+ end
+
def add_role(user, role, current_user: nil)
public_send(:"add_#{role}", user, current_user: current_user) # rubocop:disable GitlabSecurity/PublicSend
end
@@ -103,7 +107,9 @@ class ProjectTeam
if group
group.owners
else
- [project.owner]
+ # workaround until we migrate Project#owners to have membership with
+ # OWNER access level
+ Array.wrap(fetch_members(Gitlab::Access::OWNER)) | Array.wrap(project.owner)
end
end