palkan/action_policy-graphql

preauthorize doesn't default to expected values

lifeiscontent opened this issue · 4 comments

e.g.

I would expect preauthorize: { raise: false, with: PostPolicy } to default to preauthorize: { to: :index?, raise: false, with: PostPolicy } but it does not, in the README it states this is the expected behavior. So I guess this is a bug?

Default rule for preauthorize depends on the field type. From the readme:

  • for lists we use index?
  • for singleton fields we use show?

@palkan so in my case, this is a list. could it be because the options hash has raise in it?

No, it shouldn't.

Could you please show the GraphQL class?

@palkan sorry, it was because my type was not a list! My bad.