22 lines
679 B
Ruby
22 lines
679 B
Ruby
class ProtectedTag::PushAccessLevel < ActiveRecord::Base
|
|
include ProtectedTagAccess
|
|
|
|
validates :access_level, presence: true, inclusion: { in: [Gitlab::Access::MASTER,
|
|
Gitlab::Access::DEVELOPER,
|
|
Gitlab::Access::NO_ACCESS] }
|
|
|
|
def self.human_access_levels
|
|
{
|
|
Gitlab::Access::MASTER => "Masters",
|
|
Gitlab::Access::DEVELOPER => "Developers + Masters",
|
|
Gitlab::Access::NO_ACCESS => "No one"
|
|
}.with_indifferent_access
|
|
end
|
|
|
|
def check_access(user)
|
|
return false if access_level == Gitlab::Access::NO_ACCESS
|
|
|
|
super
|
|
end
|
|
end
|