gitlab-org--gitlab-foss/app/models/concerns/protected_branch_access.rb
Lin Jen-Shin d548d81990 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.
2018-09-11 18:45:49 +08:00

18 lines
330 B
Ruby

# frozen_string_literal: true
module ProtectedBranchAccess
extend ActiveSupport::Concern
include ProtectedRefAccess
included do
belongs_to :protected_branch
delegate :project, to: :protected_branch
end
def check_access(user)
return false if access_level == Gitlab::Access::NO_ACCESS
super
end
end