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.
This commit is contained in:
Lin Jen-Shin 2018-08-31 02:49:26 +08:00
parent 07da8f9128
commit d548d81990
2 changed files with 6 additions and 8 deletions

View file

@ -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

View file

@ -2,10 +2,9 @@
module ProtectedTagAccess
extend ActiveSupport::Concern
include ProtectedRefAccess
included do
include ProtectedRefAccess
belongs_to :protected_tag
delegate :project, to: :protected_tag