From addabf8e6e69d4ea125dd65d2e474ce05e3ac23e Mon Sep 17 00:00:00 2001 From: Anil Mandepudi Date: Fri, 26 Aug 2016 14:30:43 -0700 Subject: [PATCH] fix privileges in file upload and jquery-ui in tags (#4983) --- src/controllers/uploads.js | 7 ++++--- src/meta/tags.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js index 468e211f9f..ebfaa3c769 100644 --- a/src/controllers/uploads.js +++ b/src/controllers/uploads.js @@ -12,7 +12,6 @@ var meta = require('../meta'); var file = require('../file'); var plugins = require('../plugins'); var image = require('../image'); -var privileges = require('../privileges'); var uploadsController = {}; @@ -52,6 +51,8 @@ uploadsController.uploadPost = function(req, res, next) { }; function uploadAsImage(req, uploadedFile, callback) { + var privileges = require('../privileges'); + async.waterfall([ function(next) { privileges.categories.can('upload:post:image', req.body.cid, req.uid, next); @@ -79,6 +80,8 @@ function uploadAsImage(req, uploadedFile, callback) { } function uploadAsFile(req, uploadedFile, callback) { + var privileges = require('../privileges'); + async.waterfall([ function(next) { privileges.categories.can('upload:post:file', req.body.cid, req.uid, next); @@ -245,6 +248,4 @@ function deleteTempFiles(files) { }); } - - module.exports = uploadsController; diff --git a/src/meta/tags.js b/src/meta/tags.js index 4eaba839e6..400dea9025 100644 --- a/src/meta/tags.js +++ b/src/meta/tags.js @@ -52,7 +52,7 @@ module.exports = function(Meta) { href: nconf.get('relative_path') + '/manifest.json' }, { rel: "prefetch", - href: nconf.get('relative_path') + '/vendor/jquery/js/jquery-ui-1.10.4.custom.js' + (Meta.config['cache-buster'] ? '?v=' + Meta.config['cache-buster'] : '') + href: nconf.get('relative_path') + '/vendor/jquery/js/jquery-ui.js' + (Meta.config['cache-buster'] ? '?v=' + Meta.config['cache-buster'] : '') }]; // Touch icons for mobile-devices