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(:topic_id)
|
||||||
params.require(:timestamp)
|
params.require(:timestamp)
|
||||||
|
|
||||||
guardian.ensure_can_change_post_owner!
|
guardian.ensure_can_change_post_timestamps!
|
||||||
|
|
||||||
begin
|
begin
|
||||||
PostTimestampChanger.new( topic_id: params[:topic_id].to_i,
|
PostTimestampChanger.new( topic_id: params[:topic_id].to_i,
|
||||||
|
|
|
@ -185,6 +185,10 @@ module PostGuardian
|
||||||
is_admin?
|
is_admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def can_change_post_timestamps?
|
||||||
|
is_admin?
|
||||||
|
end
|
||||||
|
|
||||||
def can_wiki?(post)
|
def can_wiki?(post)
|
||||||
return false unless authenticated?
|
return false unless authenticated?
|
||||||
return true if is_staff? || @user.has_trust_level?(TrustLevel[4])
|
return true if is_staff? || @user.has_trust_level?(TrustLevel[4])
|
||||||
|
|
Loading…
Reference in New Issue