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 @@ ...@@ -2,19 +2,18 @@
module ProtectedBranchAccess module ProtectedBranchAccess
extend ActiveSupport::Concern extend ActiveSupport::Concern
include ProtectedRefAccess
include EE::ProtectedRefAccess # Can't use prepend. It'll override wrongly
included do included do
include ProtectedRefAccess
prepend EE::ProtectedRefAccess
belongs_to :protected_branch belongs_to :protected_branch
delegate :project, to: :protected_branch delegate :project, to: :protected_branch
end
def check_access(user) def check_access(user)
return false if access_level == Gitlab::Access::NO_ACCESS return false if access_level == Gitlab::Access::NO_ACCESS
super super
end
end end
end end
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
module ProtectedTagAccess module ProtectedTagAccess
extend ActiveSupport::Concern extend ActiveSupport::Concern
include ProtectedRefAccess
include EE::ProtectedRefAccess # Can't use prepend. It'll override wrongly
included do included do
include ProtectedRefAccess
prepend EE::ProtectedRefAccess
belongs_to :protected_tag belongs_to :protected_tag
delegate :project, to: :protected_tag delegate :project, to: :protected_tag
......
...@@ -10,7 +10,7 @@ module EE ...@@ -10,7 +10,7 @@ module EE
extend ActiveSupport::Concern extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
prepended do included do
belongs_to :user belongs_to :user
belongs_to :group 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