RAZ-3125: Speed up folder api calls
- Rewrote to check permissions in query instead of looping over each folder