jsonapi-suite / jsonapi_compliable

MIT License
20 stars 35 forks source link

having filter guards call controller method causes issues when resource is sideloaded #90

Open Dishwasha opened 6 years ago

Dishwasha commented 6 years ago

Unless the controller method used for a filter guard exists on all controllers a resource could be sideloaded from, using a guard on an allow_filter will break when the filtered resource is fetched through sideloading. Since changing jsonapi_compliable to call guard on resource rather than controller will created a backwards incompatible change, I'm reporting the issue rather than attempting to fix it.

thec0keman commented 5 years ago

Just want to piggy back here that guards on the resource make a lot more sense.

The docs do indicate 'runtime context', but the example is a bit misleading.