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:
parent
aa615cd570
commit
3f75f3d59b
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user