From d548d8199033cfb0e067dfe2c32ff2397386088d Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 31 Aug 2018 02:49:26 +0800 Subject: 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. --- app/models/concerns/protected_branch_access.rb | 11 +++++------ app/models/concerns/protected_tag_access.rb | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'app') 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 diff --git a/app/models/concerns/protected_tag_access.rb b/app/models/concerns/protected_tag_access.rb index 04bd54d6b1c..3f5696c0749 100644 --- a/app/models/concerns/protected_tag_access.rb +++ b/app/models/concerns/protected_tag_access.rb @@ -2,10 +2,9 @@ module ProtectedTagAccess extend ActiveSupport::Concern + include ProtectedRefAccess included do - include ProtectedRefAccess - belongs_to :protected_tag delegate :project, to: :protected_tag -- cgit v1.2.3