提交 0ae208dd 编写于 作者: J Jan Provaznik

Merge branch 'graphql-include-authorization-for-mutations' into 'master'

Include AuthorizeResource module for all mutations

See merge request gitlab-org/gitlab-ce!30243
......@@ -3,8 +3,6 @@
module Mutations
module AwardEmojis
class Base < BaseMutation
include Gitlab::Graphql::Authorize::AuthorizeResource
authorize :award_emoji
argument :awardable_id,
......
......@@ -2,6 +2,7 @@
module Mutations
class BaseMutation < GraphQL::Schema::RelayClassicMutation
prepend Gitlab::Graphql::Authorize::AuthorizeResource
prepend Gitlab::Graphql::CopyFieldDescription
field :errors, [GraphQL::STRING_TYPE],
......
......@@ -3,7 +3,6 @@
module Mutations
module MergeRequests
class Base < BaseMutation
include Gitlab::Graphql::Authorize::AuthorizeResource
include Mutations::ResolvesProject
argument :project_path, GraphQL::ID_TYPE,
......
......@@ -3,8 +3,6 @@
module Mutations
module Notes
class Base < BaseMutation
include Gitlab::Graphql::Authorize::AuthorizeResource
field :note,
Types::Notes::NoteType,
null: true,
......
......@@ -424,12 +424,8 @@ Will generate a field called `mergeRequestSetWip` that
### Authorizing resources
To authorize resources inside a mutation, we can include the
`Gitlab::Graphql::Authorize::AuthorizeResource` concern in the
mutation.
This allows us to provide the required abilities on the mutation like
this:
To authorize resources inside a mutation, we first provide the required
abilities on the mutation like this:
```ruby
module Mutations
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册