diff options
Diffstat (limited to 'lib/gitlab/import_export/project/relation_factory.rb')
-rw-r--r-- | lib/gitlab/import_export/project/relation_factory.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/import_export/project/relation_factory.rb b/lib/gitlab/import_export/project/relation_factory.rb index 568315930d8..4134c428500 100644 --- a/lib/gitlab/import_export/project/relation_factory.rb +++ b/lib/gitlab/import_export/project/relation_factory.rb @@ -165,9 +165,21 @@ module Gitlab end def setup_protected_branch_access_level + return if root_group_owner? + return if @relation_hash['access_level'] == Gitlab::Access::NO_ACCESS + return if @relation_hash['access_level'] == Gitlab::Access::MAINTAINER + @relation_hash['access_level'] = Gitlab::Access::MAINTAINER end + def root_group_owner? + root_ancestor = @importable.root_ancestor + + return false unless root_ancestor.is_a?(::Group) + + root_ancestor.max_member_access_for_user(@user) == Gitlab::Access::OWNER + end + def compute_relative_position return unless max_relative_position |