about summary refs log tree commit diff
path: root/app/policies
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-05-06 06:39:02 +0900
committerGitHub <noreply@github.com>2021-05-05 23:39:02 +0200
commit7cb34b32f8bc925b56c79dbcf053671f93f2eb42 (patch)
treeb05d123350c4af203a6009418b1bfc7056820b27 /app/policies
parentd9ae3db8d5543cf0b7fa44186c191c9bb2472d23 (diff)
Add management of delivery availability in Federation settings (#15771)
* Add management of delivery availavility in Federation settings

* fix translate

* Remove useless object creation

* Fix DeepSource issue

* Add shortcut for all

* Fix DeepSource(skipcq)

* Change 'remove' to 'clear'

* Fix style

* Change class method name (exhausted_deliveries_key_by)
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/delivery_policy.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/policies/delivery_policy.rb b/app/policies/delivery_policy.rb
new file mode 100644
index 000000000..24d06c168
--- /dev/null
+++ b/app/policies/delivery_policy.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DeliveryPolicy < ApplicationPolicy
+  def clear_delivery_errors?
+    admin?
+  end
+
+  def restart_delivery?
+    admin?
+  end
+
+  def stop_delivery?
+    admin?
+  end
+end