mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:16:41 +08:00
REFACTOR: Edit title respects min trust to edit post
Follow up to: 241d8f6452
This commit is contained in:
parent
49c750ca78
commit
926d5f1c0a
|
@ -4,14 +4,9 @@ module LimitedEdit
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
def edit_time_limit_expired?(user)
|
||||
return true if user.trust_level < SiteSetting.min_trust_to_edit_post
|
||||
time_limit = user_time_limit(user)
|
||||
if user.trust_level < SiteSetting.min_trust_to_edit_post
|
||||
true
|
||||
elsif created_at && time_limit > 0
|
||||
created_at < time_limit.minutes.ago
|
||||
else
|
||||
false
|
||||
end
|
||||
created_at && (time_limit > 0) && (created_at < time_limit.minutes.ago)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in New Issue
Block a user