summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 10:32:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 10:32:43 +0000
commit547a5884d1ab6a22d9fc9ce79e5cf6f0310bc23d (patch)
tree655c2c0252d6ac08f0a825fac872f83845ee2e7f /lib
parent25e94f0fc4c4666dbbacfcbdd6bce0380b8fe1d0 (diff)
downloadgitlab-ce-547a5884d1ab6a22d9fc9ce79e5cf6f0310bc23d.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-4-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities/project.rb4
-rw-r--r--lib/gitlab/background_migration/user_mentions/models/group.rb4
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/entities/project.rb b/lib/api/entities/project.rb
index df0c1d7a4c5..41320d184f9 100644
--- a/lib/api/entities/project.rb
+++ b/lib/api/entities/project.rb
@@ -100,7 +100,9 @@ module API
expose :build_coverage_regex
expose :ci_config_path, if: -> (project, options) { Ability.allowed?(options[:current_user], :download_code, project) }
expose :shared_with_groups do |project, options|
- SharedGroupWithProject.represent(project.project_group_links, options)
+ user = options[:current_user]
+
+ SharedGroupWithProject.represent(project.visible_group_links(for_user: user), options)
end
expose :only_allow_merge_if_pipeline_succeeds
expose :allow_merge_on_skipped_pipeline
diff --git a/lib/gitlab/background_migration/user_mentions/models/group.rb b/lib/gitlab/background_migration/user_mentions/models/group.rb
index a8b4b59b06c..310723570c2 100644
--- a/lib/gitlab/background_migration/user_mentions/models/group.rb
+++ b/lib/gitlab/background_migration/user_mentions/models/group.rb
@@ -11,6 +11,10 @@ module Gitlab
has_one :saml_provider
+ def root_saml_provider
+ root_ancestor.saml_provider
+ end
+
def self.declarative_policy_class
"GroupPolicy"
end