2017-04-03 15:06:06 -04:00
|
|
|
#TODO: Refactor, checking EE
|
2017-03-17 15:55:15 -04:00
|
|
|
# module ProtectedRefAccess
|
|
|
|
# extend ActiveSupport::Concern
|
2017-03-15 18:29:07 -04:00
|
|
|
|
2017-03-17 15:55:15 -04:00
|
|
|
# included do
|
|
|
|
# # belongs_to :protected_branch
|
|
|
|
# # delegate :project, to: :protected_branch
|
2017-03-15 18:29:07 -04:00
|
|
|
|
2017-03-17 15:55:15 -04:00
|
|
|
# scope :master, -> { where(access_level: Gitlab::Access::MASTER) }
|
|
|
|
# scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) }
|
|
|
|
# end
|
2017-03-15 18:29:07 -04:00
|
|
|
|
2017-03-17 15:55:15 -04:00
|
|
|
# def humanize
|
|
|
|
# self.class.human_access_levels[self.access_level]
|
|
|
|
# end
|
2017-03-15 18:29:07 -04:00
|
|
|
|
2017-03-17 15:55:15 -04:00
|
|
|
# def check_access(user)
|
|
|
|
# return true if user.is_admin?
|
2017-03-15 18:29:07 -04:00
|
|
|
|
2017-03-17 15:55:15 -04:00
|
|
|
# project.team.max_member_access(user.id) >= access_level
|
|
|
|
# end
|
|
|
|
# end
|