Module: JSONAPI::Authorization::PunditScopedResource::ClassMethods

Defined in:
lib/jsonapi/authorization/pundit_scoped_resource.rb

Instance Method Summary collapse

Instance Method Details

#records(options = {}) ⇒ Object



11
12
13
14
# File 'lib/jsonapi/authorization/pundit_scoped_resource.rb', line 11

def records(options = {})
  user_context = JSONAPI::Authorization.configuration.user_context(options[:context])
  ::Pundit.policy_scope!(user_context, _model_class)
end