Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/protected_ref_access.rb')
-rw-r--r--app/models/concerns/protected_ref_access.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/concerns/protected_ref_access.rb b/app/models/concerns/protected_ref_access.rb
index 208937f2aff..01cb5a14762 100644
--- a/app/models/concerns/protected_ref_access.rb
+++ b/app/models/concerns/protected_ref_access.rb
@@ -2,7 +2,6 @@
module ProtectedRefAccess
extend ActiveSupport::Concern
-
HUMAN_ACCESS_LEVELS = {
Gitlab::Access::MAINTAINER => "Maintainers",
Gitlab::Access::DEVELOPER => "Developers + Maintainers",
@@ -51,3 +50,13 @@ module ProtectedRefAccess
project.team.max_member_access(user.id) >= access_level
end
end
+
+ProtectedRefAccess.include_if_ee('EE::ProtectedRefAccess::Scopes') # rubocop: disable Cop/InjectEnterpriseEditionModule
+ProtectedRefAccess.prepend_if_ee('EE::ProtectedRefAccess') # rubocop: disable Cop/InjectEnterpriseEditionModule
+
+# When using `prepend` (or `include` for that matter), the `ClassMethods`
+# constants are not merged. This means that `class_methods` in
+# `EE::ProtectedRefAccess` would be ignored.
+#
+# To work around this, we prepend the `ClassMethods` constant manually.
+ProtectedRefAccess::ClassMethods.prepend_if_ee('EE::ProtectedRefAccess::ClassMethods')