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

rule_type.rb « protection « packages « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e2ea2d89d2d9a43146abc869a0011666f17055d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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 :id,
          ::Types::GlobalIDType[::Packages::Protection::Rule],
          null: false,
          description: 'ID of the package protection rule.'

        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