Quellcode durchsuchen

Ensure only people allowed to see the poll can actually vote (#10161)

ThibG vor 5 Jahren
Ursprung
Commit
7a25bb858a
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      app/policies/poll_policy.rb

+ 1 - 1
app/policies/poll_policy.rb

@@ -2,6 +2,6 @@
 
 class PollPolicy < ApplicationPolicy
   def vote?
-    !current_account.blocking?(record.account) && !record.account.blocking?(current_account)
+    StatusPolicy.new(current_account, record.status).show? && !current_account.blocking?(record.account) && !record.account.blocking?(current_account)
   end
 end