fix post trashing

This commit is contained in:
Sam 2013-05-07 17:56:56 +10:00
parent a232e77fa8
commit 20493106cd
2 changed files with 3 additions and 3 deletions

View File

@ -432,7 +432,7 @@ Discourse.TopicController = Discourse.ObjectController.extend({
deletePost: function(post) {
// Moderators can delete posts. Regular users can only create a deleted at message.
if (Discourse.get('currentUser.moderator')) {
if (Discourse.get('currentUser.staff')) {
post.set('deleted_at', new Date());
} else {
post.set('cooked', Discourse.Markdown.cook(Em.String.i18n("post.deleted_by_author")));

View File

@ -186,8 +186,8 @@ class PostsController < ApplicationController
def find_post_from_params
finder = Post.where(id: params[:id] || params[:post_id])
# Include deleted posts if the user is a moderator
finder = finder.with_deleted if current_user.try(:moderator?)
# Include deleted posts if the user is staff
finder = finder.with_deleted if current_user.try(:staff?)
post = finder.first
guardian.ensure_can_see!(post)