Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/packages/protection/rule.rb')
-rw-r--r--app/models/packages/protection/rule.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/packages/protection/rule.rb b/app/models/packages/protection/rule.rb
index bb65be92b90..4e8b47f600c 100644
--- a/app/models/packages/protection/rule.rb
+++ b/app/models/packages/protection/rule.rb
@@ -4,18 +4,16 @@ module Packages
module Protection
class Rule < ApplicationRecord
enum package_type: Packages::Package.package_types.slice(:npm)
+ enum push_protected_up_to_access_level:
+ Gitlab::Access.sym_options_with_owner.slice(:developer, :maintainer, :owner),
+ _prefix: :push_protected_up_to
belongs_to :project, inverse_of: :package_protection_rules
validates :package_name_pattern, presence: true, uniqueness: { scope: [:project_id, :package_type] },
length: { maximum: 255 }
validates :package_type, presence: true
- validates :push_protected_up_to_access_level, presence: true,
- inclusion: { in: [
- Gitlab::Access::DEVELOPER,
- Gitlab::Access::MAINTAINER,
- Gitlab::Access::OWNER
- ] }
+ validates :push_protected_up_to_access_level, presence: true
end
end
end