diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /lib/gitlab/user_access.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'lib/gitlab/user_access.rb')
-rw-r--r-- | lib/gitlab/user_access.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/user_access.rb b/lib/gitlab/user_access.rb index 1c6ddc2e70f..eec89e1ab72 100644 --- a/lib/gitlab/user_access.rb +++ b/lib/gitlab/user_access.rb @@ -90,9 +90,13 @@ module Gitlab def can_collaborate?(ref) assert_project! + can_push? || branch_allows_collaboration_for?(ref) + end + + def branch_allows_collaboration_for?(ref) # Checking for an internal project or group to prevent an infinite loop: # https://gitlab.com/gitlab-org/gitlab/issues/36805 - can_push? || (!project.internal? && project.branch_allows_collaboration?(user, ref)) + (!project.internal? && project.branch_allows_collaboration?(user, ref)) end def permission_cache |