about summary refs log tree commit diff
path: root/app/policies
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-19 00:58:53 +0200
committerGitHub <noreply@github.com>2018-08-19 00:58:53 +0200
commit9dd5639f90e7a256863a2b1fc199390def8bdb14 (patch)
tree1ec4bb24d5a03c1b17a9e6d16f721298f1f619c0 /app/policies
parentc6eab9e0aa06928e644cfe8445c0787e5515cd4f (diff)
Add admin function to deactivate all invites (#8279)
Fix #8261
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/invite_policy.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/invite_policy.rb b/app/policies/invite_policy.rb
index a2a65f934..14236f78b 100644
--- a/app/policies/invite_policy.rb
+++ b/app/policies/invite_policy.rb
@@ -9,6 +9,10 @@ class InvitePolicy < ApplicationPolicy
     min_required_role?
   end
 
+  def deactivate_all?
+    admin?
+  end
+
   def destroy?
     owner? || (Setting.min_invite_role == 'admin' ? admin? : staff?)
   end