about summary refs log tree commit diff
path: root/app/policies
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-10-12 16:33:49 +0200
committerGitHub <noreply@github.com>2020-10-12 16:33:49 +0200
commit5e1364c448222c964faa469b6b5bfe9adf701c1a (patch)
treebf13de38f07f6a8ec4bdce9c6242c3c472bfddea /app/policies
parentdc52a778e111a67a5275dd4afecf3991e279e005 (diff)
Add IP-based rules (#14963)
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/ip_block_policy.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/policies/ip_block_policy.rb b/app/policies/ip_block_policy.rb
new file mode 100644
index 000000000..34dbd746a
--- /dev/null
+++ b/app/policies/ip_block_policy.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class IpBlockPolicy < ApplicationPolicy
+  def index?
+    admin?
+  end
+
+  def create?
+    admin?
+  end
+
+  def destroy?
+    admin?
+  end
+end