mirror of
https://github.com/Foltik/Shimapan
synced 2025-02-26 00:55:20 -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) {
|
router.post('/', dest.single('file'), function(req, res) {
|
||||||
//if (!req.payload._id) {
|
if (req.payload.scope.indexOf('file.upload') === -1) {
|
||||||
//console.log("Got unauthorized POST attempt");
|
res.status(401).json({'message': 'Permission error.'});
|
||||||
//res.status(401);
|
return;
|
||||||
//return;
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
var entry = {
|
var entry = {
|
||||||
name: genFileName(),
|
name: genFileName(),
|
||||||
|
Loading…
Reference in New Issue
Block a user