Commit 585602a1 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Replace authorized_resource? with authorize method

parent c9c83537
...@@ -7,6 +7,8 @@ module Mutations ...@@ -7,6 +7,8 @@ module Mutations
graphql_name 'JiraImportUsers' graphql_name 'JiraImportUsers'
authorize :admin_project
field :jira_users, field :jira_users,
[Types::JiraUserType], [Types::JiraUserType],
null: true, null: true,
...@@ -29,12 +31,6 @@ module Mutations ...@@ -29,12 +31,6 @@ module Mutations
errors: service_response.errors errors: service_response.errors
} }
end end
private
def authorized_resource?(project)
Ability.allowed?(context[:current_user], :admin_project, project)
end
end end
end end
end end
...@@ -7,6 +7,8 @@ module Mutations ...@@ -7,6 +7,8 @@ module Mutations
graphql_name 'JiraImportStart' graphql_name 'JiraImportStart'
authorize :admin_project
field :jira_import, field :jira_import,
Types::JiraImportType, Types::JiraImportType,
null: true, null: true,
...@@ -40,12 +42,6 @@ module Mutations ...@@ -40,12 +42,6 @@ module Mutations
errors: service_response.errors errors: service_response.errors
} }
end end
private
def authorized_resource?(project)
Ability.allowed?(context[:current_user], :admin_project, project)
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment