diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index d9011d530d..33be04f993 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -28,7 +28,7 @@ define('forum/topic/posts', [ data.posts.forEach(function(post) { post.selfPost = !!app.user.uid && parseInt(post.uid, 10) === parseInt(app.user.uid, 10); post.display_edit_tools = (ajaxify.data.privileges.editOwnPosts && post.selfPost) || ajaxify.data.privileges.isAdminOrMod; - post.display_delete_tools = (ajaxify.data.privileges.editOwnPosts && post.selfPost) || ajaxify.data.privileges.isAdminOrMod; + post.display_delete_tools = (ajaxify.data.privileges.deleteOwnPosts && post.selfPost) || ajaxify.data.privileges.isAdminOrMod; post.display_moderator_tools = post.display_edit_tools || post.display_delete_tools; post.display_move_tools = ajaxify.data.privileges.isAdminOrMod; post.display_post_menu = ajaxify.data.privileges.isAdminOrMod || post.selfPost || ((app.user.uid || ajaxify.data.postSharing.length) && !post.deleted); diff --git a/src/categories/create.js b/src/categories/create.js index a42c260155..4f00da8149 100644 --- a/src/categories/create.js +++ b/src/categories/create.js @@ -48,7 +48,7 @@ module.exports = function(Categories) { function(data, next) { category = data.category; - var defaultPrivileges = ['find', 'read', 'topics:read', 'topics:create', 'topics:reply', 'edit', 'delete', 'upload:post:image']; + var defaultPrivileges = ['find', 'read', 'topics:read', 'topics:create', 'topics:reply', 'posts:edit', 'posts:delete', 'upload:post:image']; async.series([ async.apply(db.setObject, 'category:' + category.cid, category), diff --git a/src/privileges.js b/src/privileges.js index cc1e4d48ed..34b6e6fb69 100644 --- a/src/privileges.js +++ b/src/privileges.js @@ -8,8 +8,8 @@ privileges.userPrivilegeList = [ 'topics:read', 'topics:create', 'topics:reply', - 'edit', - 'delete', + 'posts:edit', + 'posts:delete', 'topics:delete', 'upload:post:image', 'upload:post:file', @@ -23,8 +23,8 @@ privileges.groupPrivilegeList = [ 'groups:topics:read', 'groups:topics:create', 'groups:topics:reply', - 'groups:edit', - 'groups:delete', + 'groups:posts:edit', + 'groups:posts:delete', 'groups:topics:delete', 'groups:upload:post:image', 'groups:upload:post:file', diff --git a/src/privileges/categories.js b/src/privileges/categories.js index 96eaba84c4..0baf08af91 100644 --- a/src/privileges/categories.js +++ b/src/privileges/categories.js @@ -365,11 +365,11 @@ module.exports = function(privileges) { 'topics:reply': function(next) { groups.isMember(uid, 'cid:' + cid + ':privileges:topics:reply', next); }, - 'edit': function(next) { - groups.isMember(uid, 'cid:' + cid + ':privileges:edit', next); + 'posts:edit': function(next) { + groups.isMember(uid, 'cid:' + cid + ':privileges:posts:edit', next); }, - 'delete': function(next) { - groups.isMember(uid, 'cid:' + cid + ':privileges:delete', next); + 'posts:delete': function(next) { + groups.isMember(uid, 'cid:' + cid + ':privileges:posts:delete', next); }, 'topics:delete': function(next) { groups.isMember(uid, 'cid:' + cid + ':privileges:topics:delete', next); @@ -392,11 +392,11 @@ module.exports = function(privileges) { 'groups:topics:reply': function(next) { groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:topics:reply', next); }, - 'groups:edit': function(next) { - groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:edit', next); + 'groups:posts:edit': function(next) { + groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:posts:edit', next); }, - 'groups:delete': function(next) { - groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:delete', next); + 'groups:posts:delete': function(next) { + groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:posts:delete', next); }, 'groups:topics:delete': function(next) { groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:topics:delete', next); diff --git a/src/privileges/posts.js b/src/privileges/posts.js index c946e8c744..fe43a631c6 100644 --- a/src/privileges/posts.js +++ b/src/privileges/posts.js @@ -30,7 +30,7 @@ module.exports = function(privileges) { isOwner: async.apply(posts.isOwner, pids, uid), 'topics:read': async.apply(helpers.isUserAllowedTo, 'topics:read', uid, cids), read: async.apply(helpers.isUserAllowedTo, 'read', uid, cids), - edit: async.apply(helpers.isUserAllowedTo, 'edit', uid, cids), + 'posts:edit': async.apply(helpers.isUserAllowedTo, 'posts:edit', uid, cids), }, next); } ], function(err, results) { @@ -42,7 +42,7 @@ module.exports = function(privileges) { for (var i=0; iAccess Topics
  • Create Topics
  • Reply to Topics
  • -
  • Edit Posts
  • -
  • Delete Posts
  • +
  • Edit Posts
  • +
  • Delete Posts
  • Delete Topics
  • diff --git a/src/views/admin/partials/categories/users.tpl b/src/views/admin/partials/categories/users.tpl index c97d452d5d..772053d5b0 100644 --- a/src/views/admin/partials/categories/users.tpl +++ b/src/views/admin/partials/categories/users.tpl @@ -10,8 +10,8 @@
  • Access Topics
  • Create Topics
  • Reply to Topics
  • -
  • Edit Posts
  • -
  • Delete Posts
  • +
  • Edit Posts
  • +
  • Delete Posts
  • Delete Topics
  • Moderator