gitlab-org--gitlab-foss/app/models/concerns/protected_ref_access.rb

23 lines
576 B
Ruby
Raw Normal View History

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