diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-04 06:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-04 06:09:19 +0300 |
commit | 03a2dce94a42ba978e60d02aeb0ee9909a0e947e (patch) | |
tree | ff0c3166e3e3ef6d91148963b0dd274cdff95411 /app/models/concerns | |
parent | 570e71a92204fd24ef8c8176702941e2d45bcfb5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/has_user_type.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/concerns/has_user_type.rb b/app/models/concerns/has_user_type.rb index 2d0ff82e624..c3f702a4e69 100644 --- a/app/models/concerns/has_user_type.rb +++ b/app/models/concerns/has_user_type.rb @@ -74,4 +74,21 @@ module HasUserType # https://gitlab.com/gitlab-org/gitlab/-/issues/346058 '****' end + + def resource_bot_resource + return unless project_bot? + + projects&.first || groups&.first + end + + def resource_bot_owners + return [] unless project_bot? + + resource = resource_bot_resource + return [] unless resource + + return resource.maintainers if resource.is_a?(Project) + + resource.owners + end end |