diff --git a/install/package.json b/install/package.json index 727f414031..48a6784957 100644 --- a/install/package.json +++ b/install/package.json @@ -77,9 +77,9 @@ "nodebb-plugin-spam-be-gone": "0.5.4", "nodebb-rewards-essentials": "0.0.11", "nodebb-theme-lavender": "5.0.7", - "nodebb-theme-persona": "9.0.27", + "nodebb-theme-persona": "9.0.28", "nodebb-theme-slick": "1.2.9", - "nodebb-theme-vanilla": "10.1.0", + "nodebb-theme-vanilla": "10.1.1", "nodebb-widget-essentials": "4.0.7", "nodemailer": "^4.6.5", "passport": "^0.4.0", diff --git a/src/privileges/topics.js b/src/privileges/topics.js index 0cbf49e7ae..9e387acc77 100644 --- a/src/privileges/topics.js +++ b/src/privileges/topics.js @@ -16,7 +16,7 @@ module.exports = function (privileges) { privileges.topics.get = function (tid, uid, callback) { var topic; - var privs = ['topics:reply', 'topics:read', 'topics:tag', 'topics:delete', 'posts:edit', 'posts:history', 'posts:delete', 'posts:view_deleted', 'read']; + var privs = ['topics:reply', 'topics:read', 'topics:tag', 'topics:delete', 'posts:edit', 'posts:history', 'posts:delete', 'posts:view_deleted', 'read', 'purge']; async.waterfall([ async.apply(topics.getTopicFields, tid, ['cid', 'uid', 'locked', 'deleted']), function (_topic, next) { @@ -37,6 +37,7 @@ module.exports = function (privileges) { var isAdminOrMod = results.isAdministrator || results.isModerator; var editable = isAdminOrMod; var deletable = isAdminOrMod || (isOwner && privData['topics:delete']); + var purge = results.isAdministrator || privData.purge; plugins.fireHook('filter:privileges.topics.get', { 'topics:reply': (privData['topics:reply'] && !locked && !deleted) || isAdminOrMod, @@ -51,6 +52,7 @@ module.exports = function (privileges) { view_thread_tools: editable || deletable, editable: editable, deletable: deletable, + purge: purge, view_deleted: isAdminOrMod || isOwner, isAdminOrMod: isAdminOrMod, disabled: disabled, diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js index 9b2da8ee01..96bd3a2ad7 100644 --- a/src/socket.io/posts/tools.js +++ b/src/socket.io/posts/tools.js @@ -39,6 +39,9 @@ module.exports = function (SocketPosts) { canDelete: function (next) { privileges.posts.canDelete(data.pid, socket.uid, next); }, + canPurge: function (next) { + privileges.posts.canPurge(data.pid, socket.uid, next); + }, canFlag: function (next) { privileges.posts.canFlag(data.pid, socket.uid, next); }, @@ -62,6 +65,7 @@ module.exports = function (SocketPosts) { posts.selfPost = socket.uid && socket.uid === parseInt(posts.uid, 10); posts.display_edit_tools = results.canEdit.flag; posts.display_delete_tools = results.canDelete.flag; + posts.display_purge_tools = results.canPurge; posts.display_flag_tools = socket.uid && !posts.selfPost && results.canFlag.flag; posts.display_moderator_tools = posts.display_edit_tools || posts.display_delete_tools; posts.display_move_tools = results.isAdmin || results.isModerator;