2018-11-09 18:39:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-16 13:04:41 +00:00
|
|
|
module Gitlab
|
|
|
|
module Graphql
|
|
|
|
# Allow fields to declare permissions their objects must have. The field
|
|
|
|
# will be set to nil unless all required permissions are present.
|
2018-05-23 07:55:14 +00:00
|
|
|
module Authorize
|
|
|
|
extend ActiveSupport::Concern
|
2017-08-16 13:04:41 +00:00
|
|
|
|
2018-05-23 07:55:14 +00:00
|
|
|
def self.use(schema_definition)
|
2019-06-21 14:20:00 +00:00
|
|
|
schema_definition.instrument(:field, Gitlab::Graphql::Authorize::Instrumentation.new, after_built_ins: true)
|
2017-08-16 13:04:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|