Update more API endpoints to use new user model

This commit is contained in:
advplyr 2024-08-11 15:15:34 -05:00
parent 9facf77ff1
commit afc16358ca
23 changed files with 856 additions and 404 deletions

View file

@ -337,7 +337,7 @@ class CollectionController {
if (req.method == 'DELETE' && !req.userNew.canDelete) {
Logger.warn(`[CollectionController] User "${req.userNew.username}" attempted to delete without permission`)
return res.sendStatus(403)
} else if ((req.method == 'PATCH' || req.method == 'POST') && !req.user.canUpdate) {
} else if ((req.method == 'PATCH' || req.method == 'POST') && !req.userNew.canUpdate) {
Logger.warn(`[CollectionController] User "${req.userNew.username}" attempted to update without permission`)
return res.sendStatus(403)
}