-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Is your feature request related to a problem? Please describe.
I enjoy using FastCRUD. It works beautifully for my admin-apis but it seemingly falls short when trying to use with restricted user apis.
For example: I have a table for "items" and and item is linked to a user by their id. Now, i dont want anyone to be able to submit a userid from the frontend (as to prevent creating items on other users behalf). So my thought was to use dependencies to check the http-only cookie, get the database user from it and modify the "item" to have (or set) the correct userid. It appears that dependencies can not modify what has been send though. (some sort of database-pre-processing)
Another thing would be to only grab items that belong to the currenctly logged in user. (some sort of column filter)
I saw that i can implement something like that (with FastCRUD) but its so much extra code that i feel like its not worth to use it and simply go the traditional route, which also cant be the solution.
Describe the solution you'd like
A way to modify data directly before its written to the database (as to not mess wth schemas) & a way to simplify user-tailored apis with column filters. Both could be smilar to the "dependencies". A MITM function basically.
Describe alternatives you've considered
I dont know of any alternatives.