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/mutations/jira_import/start.rb')
-rw-r--r--app/graphql/mutations/jira_import/start.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/graphql/mutations/jira_import/start.rb b/app/graphql/mutations/jira_import/start.rb
index 3d50ebde13a..e31aaf53a09 100644
--- a/app/graphql/mutations/jira_import/start.rb
+++ b/app/graphql/mutations/jira_import/start.rb
@@ -3,10 +3,12 @@
module Mutations
module JiraImport
class Start < BaseMutation
- include ResolvesProject
+ include FindsProject
graphql_name 'JiraImportStart'
+ authorize :admin_project
+
field :jira_import,
Types::JiraImportType,
null: true,
@@ -27,7 +29,7 @@ module Mutations
description: 'The mapping of Jira to GitLab users.'
def resolve(project_path:, jira_project_key:, users_mapping:)
- project = authorized_find!(full_path: project_path)
+ project = authorized_find!(project_path)
mapping = users_mapping.to_ary.map { |map| map.to_hash }
service_response = ::JiraImport::StartImportService
@@ -40,16 +42,6 @@ module Mutations
errors: service_response.errors
}
end
-
- private
-
- def find_object(full_path:)
- resolve_project(full_path: full_path)
- end
-
- def authorized_resource?(project)
- Ability.allowed?(context[:current_user], :admin_project, project)
- end
end
end
end