Commit 00af259d authored by Lin Jen-Shin's avatar Lin Jen-Shin

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.
parent 66282921
......@@ -2,19 +2,18 @@
module ProtectedBranchAccess
extend ActiveSupport::Concern
include ProtectedRefAccess
include EE::ProtectedRefAccess # Can't use prepend. It'll override wrongly
included do
include ProtectedRefAccess
prepend EE::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
......@@ -2,11 +2,10 @@
module ProtectedTagAccess
extend ActiveSupport::Concern
include ProtectedRefAccess
include EE::ProtectedRefAccess # Can't use prepend. It'll override wrongly
included do
include ProtectedRefAccess
prepend EE::ProtectedRefAccess
belongs_to :protected_tag
delegate :project, to: :protected_tag
......
......@@ -10,7 +10,7 @@ module EE
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
prepended do
included do
belongs_to :user
belongs_to :group
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment