about summary refs log tree commit diff
path: root/app/policies/poll_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/poll_policy.rb')
-rw-r--r--app/policies/poll_policy.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/policies/poll_policy.rb b/app/policies/poll_policy.rb
new file mode 100644
index 000000000..9d69eb5bb
--- /dev/null
+++ b/app/policies/poll_policy.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class PollPolicy < ApplicationPolicy
+  def vote?
+    StatusPolicy.new(current_account, record.status).show? && !current_account.blocking?(record.account) && !record.account.blocking?(current_account)
+  end
+end