mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
pull moderator into own column, rename trust levels
This commit is contained in:
parent
0f5046a9cc
commit
62c60540be
21 changed files with 75 additions and 62 deletions
|
@ -22,7 +22,7 @@ class RateLimiter
|
|||
|
||||
def can_perform?
|
||||
return true if RateLimiter.disabled?
|
||||
return true if @user.has_trust_level?(:moderator)
|
||||
return true if @user.moderator?
|
||||
|
||||
result = $redis.get(@key)
|
||||
return true if result.blank?
|
||||
|
@ -32,7 +32,7 @@ class RateLimiter
|
|||
|
||||
def performed!
|
||||
return if RateLimiter.disabled?
|
||||
return if @user.has_trust_level?(:moderator)
|
||||
return if @user.moderator?
|
||||
|
||||
result = $redis.incr(@key).to_i
|
||||
$redis.expire(@key, @secs) if result == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue