palkan/action_policy-graphql

Lack of expose_authorization_rules for Interface

amkisko opened this issue · 2 comments

My current implementation:

    include ActionPolicy::Behaviour
    field :can_ignore, ActionPolicy::GraphQL::Types::AuthorizationResult, null: false
    def can_ignore
      allowed_to? :ignore?
    end

Try adding Fields module explicitly:

include ActionPolicy::Behaviour
include ActionPolicy::GraphQL::Fields

expose_authorization_rules ...

Well, yeah, in this case it should be explicitly included to exact interface, then it works. :)