summaryrefslogtreecommitdiff
path: root/app/models/concerns/protected_branch_access.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-08-31 02:49:26 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-09-11 18:45:49 +0800
commitd548d8199033cfb0e067dfe2c32ff2397386088d (patch)
treeece2e0fe7e0ec6dd486babb68cd56341d7609688 /app/models/concerns/protected_branch_access.rb
parent07da8f9128f507bb20d5694c1c0b5ca73e58d203 (diff)
downloadgitlab-ce-d548d8199033cfb0e067dfe2c32ff2397386088d.tar.gz
Fix how we use EE::ProtectedRefAccess
This is a mess... Using prepend will give a different ancestors chain we're not expecting. To fix this we'll need to know what exactly methods we want to use in each classes using this module.
Diffstat (limited to 'app/models/concerns/protected_branch_access.rb')
-rw-r--r--app/models/concerns/protected_branch_access.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/concerns/protected_branch_access.rb b/app/models/concerns/protected_branch_access.rb
index 744f7f48dc8..58761fce952 100644
--- a/app/models/concerns/protected_branch_access.rb
+++ b/app/models/concerns/protected_branch_access.rb
@@ -2,18 +2,17 @@
module ProtectedBranchAccess
extend ActiveSupport::Concern
+ include ProtectedRefAccess
included do
- include ProtectedRefAccess
-
belongs_to :protected_branch
delegate :project, to: :protected_branch
+ end
- def check_access(user)
- return false if access_level == Gitlab::Access::NO_ACCESS
+ def check_access(user)
+ return false if access_level == Gitlab::Access::NO_ACCESS
- super
- end
+ super
end
end