Sha256: 04aaa3ac0378914447f5685cca9564e792811b2992062d428234f2fc0fc12844
Contents?: true
Size: 682 Bytes
Versions: 15
Compression:
Stored size: 682 Bytes
Contents
require 'jsonapi/authorization/default_pundit_authorizer' module JSONAPI module Authorization class Configuration attr_accessor :authorizer attr_accessor :pundit_user def initialize self.authorizer = ::JSONAPI::Authorization::DefaultPunditAuthorizer self.pundit_user = :user end def user_context(context) if pundit_user.is_a?(Symbol) context[pundit_user] else pundit_user.call(context) end end end class << self attr_accessor :configuration end @configuration ||= Configuration.new def self.configure yield(@configuration) end end end
Version data entries
15 entries across 15 versions & 1 rubygems