Remove implicit mod privs. closes #6345 (#7648)

* feat: add upgrade script to give mods privs

* feat: give all privileges when making a moderator

* feat: remove implicit privs

* feat: give global mods default privs

* feat: more priv fixes

* feat: use lodash

* fix: remove implicit mod priv from topic delete

* fix: more privs

* fix: posts.canEdit

* fix: canDelete and canEdit

* fix: tests, remove console.log

* feat: shorter functions

* feat: add tests

* fix: uids

* fix: redis random test fail
This commit is contained in:
Barış Soner Uşaklı
2019-05-30 19:30:47 -04:00
committed by GitHub
parent ebb32e7891
commit 035f624758
15 changed files with 319 additions and 227 deletions

View File

@@ -28,9 +28,7 @@ module.exports = function (Posts) {
},
function (_postData, next) {
postData = _postData;
tids = _.uniq(postData.map(function (post) {
return post && post.tid;
}).filter(Boolean));
tids = _.uniq(postData.map(post => post && post.tid).filter(Boolean));
topics.getTopicsFields(tids, ['cid'], next);
},
@@ -42,9 +40,7 @@ module.exports = function (Posts) {
}
});
var cids = postData.map(function (post) {
return map[post.tid];
});
var cids = postData.map(post => map[post.tid]);
next(null, cids);
},
], callback);