mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
check privs pids
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
|
winston = require('winston'),
|
||||||
|
|
||||||
posts = require('../posts'),
|
posts = require('../posts'),
|
||||||
topics = require('../topics'),
|
topics = require('../topics'),
|
||||||
@@ -15,7 +16,10 @@ module.exports = function(privileges) {
|
|||||||
privileges.posts = {};
|
privileges.posts = {};
|
||||||
|
|
||||||
privileges.posts.get = function(pids, uid, callback) {
|
privileges.posts.get = function(pids, uid, callback) {
|
||||||
|
if (pids && pids.length > 100) {
|
||||||
|
var e = new Error('too many keys')
|
||||||
|
winston.warn('[TOO_MANY_KEYS] ' + pid.length, e.stack);
|
||||||
|
}
|
||||||
async.parallel({
|
async.parallel({
|
||||||
manage_content: function(next) {
|
manage_content: function(next) {
|
||||||
helpers.hasEnoughReputationFor('privileges:manage_content', uid, next);
|
helpers.hasEnoughReputationFor('privileges:manage_content', uid, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user