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/graphql/types/packages/protection/rule_type.rb')
-rw-r--r--app/graphql/types/packages/protection/rule_type.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/graphql/types/packages/protection/rule_type.rb b/app/graphql/types/packages/protection/rule_type.rb
new file mode 100644
index 00000000000..1e969d39ce2
--- /dev/null
+++ b/app/graphql/types/packages/protection/rule_type.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+module Types
+ module Packages
+ module Protection
+ class RuleType < ::Types::BaseObject
+ graphql_name 'PackagesProtectionRule'
+ description 'A packages protection rule designed to protect packages ' \
+ 'from being pushed by users with a certain access level.'
+
+ authorize :admin_package
+
+ field :package_name_pattern,
+ GraphQL::Types::String,
+ null: false,
+ description:
+ 'Package name protected by the protection rule. For example `@my-scope/my-package-*`. ' \
+ 'Wildcard character `*` allowed.'
+
+ field :package_type,
+ Types::Packages::Protection::RulePackageTypeEnum,
+ null: false,
+ description: 'Package type protected by the protection rule. For example `NPM`.'
+
+ field :push_protected_up_to_access_level,
+ Types::Packages::Protection::RuleAccessLevelEnum,
+ null: false,
+ description:
+ 'Max GitLab access level unable to push a package. For example `DEVELOPER`, `MAINTAINER`, `OWNER`.'
+ end
+ end
+ end
+end