fratzinger / feathers-casl

feathers.js + casl: hooks & channels
https://feathers-casl.netlify.app/
MIT License
40 stars 18 forks source link

Fix find with pagination #109

Closed Servaker closed 1 year ago

Servaker commented 1 year ago

To fix data filtering when a restriction on allowed fields is set in the authorizeAfter function, the parameter for calling the getItemsIsArray function was changed from { from: "result"} to { from: "automatic" }. Which led to the correct setting of the isArray=true and getOrFind=find variables and the correct data filtering in the pickFieldsForItem function.

The after - passes multi with 'pagination' with 'find' rule test has been added to the file '\test\hooks\authorize\authorize.general.test.ts'.

Fix #95

fratzinger commented 1 year ago

Thanks for the nice PR! Even with a new test. Perfect!

As this was a bug in feathers-utils, my desired fix is to leave the code as is and "just" fix it in feathers-utils. I highly appreciate your work! I continue in #110 which continues this branch. Your contribution will be included.

Thanks! 💚