FIX: Silenced users shouldn't be able to act on posts

This commit is contained in:
Robin Ward
2018-08-14 11:43:39 -04:00
parent 2927294cc6
commit 87fa26b6c8
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -36,6 +36,10 @@ module PostGuardian
already_did_flagging = taken.any? && (taken & PostActionType.notify_flag_types.values).any?
result = if authenticated? && post && !@user.anonymous?
# Silenced users can't act on posts
return false if @user.silenced?
# post made by staff, but we don't allow staff flags
return false if is_flag &&
(!SiteSetting.allow_flagging_staff?) &&