2018-08-03 17:22:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-16 05:09:13 +00:00
|
|
|
module ProtectedBranchAccess
|
|
|
|
extend ActiveSupport::Concern
|
2018-08-30 18:49:26 +00:00
|
|
|
include ProtectedRefAccess
|
2016-08-16 05:09:13 +00:00
|
|
|
|
2016-09-06 05:05:34 +00:00
|
|
|
included do
|
2016-11-29 11:21:50 +00:00
|
|
|
belongs_to :protected_branch
|
2017-04-05 17:59:46 +00:00
|
|
|
|
2016-11-29 11:21:50 +00:00
|
|
|
delegate :project, to: :protected_branch
|
2018-08-30 18:49:26 +00:00
|
|
|
end
|
2017-05-10 08:46:50 +00:00
|
|
|
|
2018-08-30 18:49:26 +00:00
|
|
|
def check_access(user)
|
|
|
|
return false if access_level == Gitlab::Access::NO_ACCESS
|
2017-05-10 08:46:50 +00:00
|
|
|
|
2018-08-30 18:49:26 +00:00
|
|
|
super
|
2016-11-29 11:21:50 +00:00
|
|
|
end
|
2016-08-16 05:09:13 +00:00
|
|
|
end
|