pyro-api icon indicating copy to clipboard operation
pyro-api copied to clipboard

Fetch routes do not limit number of items for non-admin users

Open blenzi opened this issue 2 years ago • 1 comments

The routes that fetch objects from the db behave differently for admin and non-admin users. For admin, they are limited to 50 items while for non-admin users all the items are returned. For example: https://github.com/pyronear/pyro-api/blob/main/src/app/api/endpoints/alerts.py#L135

blenzi avatar Aug 07 '23 17:08 blenzi

Indeed, that's a mistake but that's specific to this route because we don't use a crud function here. Hopefully, not too many routes are affected, thanks for spotting it!

frgfm avatar Oct 08 '23 15:10 frgfm

This has been fixed since then: if two different scope have access to a route, the limit are the same. Thanks again 🙏

frgfm avatar Jan 17 '25 11:01 frgfm