summaryrefslogtreecommitdiff
path: root/app/graphql/types/base_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/base_object.rb')
-rw-r--r--app/graphql/types/base_object.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/graphql/types/base_object.rb b/app/graphql/types/base_object.rb
index b5797f07aa6..4ad88e43f52 100644
--- a/app/graphql/types/base_object.rb
+++ b/app/graphql/types/base_object.rb
@@ -9,6 +9,13 @@ module Types
field_class Types::BaseField
edge_type_class Types::BaseEdge
+ def self.authorize(*args)
+ raise 'Cannot redefine authorize' if @authorize_args && args.any?
+
+ @authorize_args = args.freeze if args.any?
+ @authorize_args || (superclass.respond_to?(:authorize) ? superclass.authorize : nil)
+ end
+
def self.accepts(*types)
@accepts ||= []
@accepts += types