Merge pull request #4538 from kgish/master
A new guard for changing post timestamps
This commit is contained in:
commit
6a720b6011
|
@ -492,7 +492,7 @@ class TopicsController < ApplicationController
|
|||
params.require(:topic_id)
|
||||
params.require(:timestamp)
|
||||
|
||||
guardian.ensure_can_change_post_owner!
|
||||
guardian.ensure_can_change_post_timestamps!
|
||||
|
||||
begin
|
||||
PostTimestampChanger.new( topic_id: params[:topic_id].to_i,
|
||||
|
|
|
@ -185,6 +185,10 @@ module PostGuardian
|
|||
is_admin?
|
||||
end
|
||||
|
||||
def can_change_post_timestamps?
|
||||
is_admin?
|
||||
end
|
||||
|
||||
def can_wiki?(post)
|
||||
return false unless authenticated?
|
||||
return true if is_staff? || @user.has_trust_level?(TrustLevel[4])
|
||||
|
|
Loading…
Reference in New Issue