mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
BUGFIX: could not see the revisions of a post in a deleted topic
This commit is contained in:
@ -192,7 +192,6 @@ class PostsController < ApplicationController
|
||||
|
||||
def revisions
|
||||
post_revision = find_post_revision_from_params
|
||||
guardian.ensure_can_see!(post_revision)
|
||||
post_revision_serializer = PostRevisionSerializer.new(post_revision, scope: guardian, root: false)
|
||||
render_json_dump(post_revision_serializer)
|
||||
end
|
||||
@ -302,6 +301,8 @@ class PostsController < ApplicationController
|
||||
# Include deleted posts if the user is staff
|
||||
finder = finder.with_deleted if current_user.try(:staff?)
|
||||
post = finder.first
|
||||
# load deleted topic
|
||||
post.topic = Topic.with_deleted.find(post.topic_id) if current_user.try(:staff?)
|
||||
guardian.ensure_can_see!(post)
|
||||
post
|
||||
end
|
||||
|
Reference in New Issue
Block a user