Skip to content

Commit

Permalink
fix: #8508, dont allow moving topics if not moderator of target category
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 16, 2020
1 parent 1e14af4 commit 3653151
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/socket.io/topics/move.js
Expand Up @@ -13,6 +13,11 @@ module.exports = function (SocketTopics) {
throw new Error('[[error:invalid-data]]');
}

const canMove = await privileges.categories.isAdminOrMod(data.cid, socket.uid);
if (!canMove) {
throw new Error('[[error:no-privileges]]');
}

const uids = await user.getUidsFromSet('users:online', 0, -1);

await async.eachLimit(data.tids, 10, async function (tid) {
Expand Down

0 comments on commit 3653151

Please sign in to comment.