]> cat aescling's git repositories - mastodon.git/commitdiff
Ensure only people allowed to see the poll can actually vote (#10161)
authorThibG <thib@sitedethib.com>
Mon, 4 Mar 2019 21:47:47 +0000 (22:47 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 4 Mar 2019 21:47:47 +0000 (22:47 +0100)
app/policies/poll_policy.rb

index 0d839f24089a373277fd2c6b5c0b4772e44caa84..9d69eb5bb832b3c7d77a7eb6f5c968df0de0e7c7 100644 (file)
@@ -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