1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-28 05:26:44 -05:00

Add a check for upload permission

This commit is contained in:
Jack 2017-10-13 16:16:48 -04:00
parent aa615cd570
commit 3f75f3d59b
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -24,11 +24,10 @@ function genFileName() {
}
router.post('/', dest.single('file'), function(req, res) {
//if (!req.payload._id) {
//console.log("Got unauthorized POST attempt");
//res.status(401);
//return;
//}
if (req.payload.scope.indexOf('file.upload') === -1) {
res.status(401).json({'message': 'Permission error.'});
return;
}
var entry = {
name: genFileName(),