about summary refs log tree commit diff
path: root/app/policies
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-02-25 00:34:14 +0100
committerGitHub <noreply@github.com>2022-02-25 00:34:14 +0100
commit27965ce5edff20db2de1dd233c88f8393bb0da0b (patch)
tree6714a950c1b9facc8c7bd1907e81e777257e5538 /app/policies
parenta29a982eaa0536a741b43ffb3397c74e3abe7196 (diff)
Add trending statuses (#17431)
* Add trending statuses

* Fix dangling items with stale scores in localized sets

* Various fixes and improvements

- Change approve_all/reject_all to approve_accounts/reject_accounts
- Change Trends::Query methods to not mutate the original query
- Change Trends::Query#skip to offset
- Change follow recommendations to be refreshed in a transaction

* Add tests for trending statuses filtering behaviour

* Fix not applying filtering scope in controller
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/account_policy.rb4
-rw-r--r--app/policies/preview_card_policy.rb2
-rw-r--r--app/policies/preview_card_provider_policy.rb2
-rw-r--r--app/policies/status_policy.rb4
-rw-r--r--app/policies/tag_policy.rb4
5 files changed, 14 insertions, 2 deletions
diff --git a/app/policies/account_policy.rb b/app/policies/account_policy.rb
index 46237e45c..cc23771e7 100644
--- a/app/policies/account_policy.rb
+++ b/app/policies/account_policy.rb
@@ -68,4 +68,8 @@ class AccountPolicy < ApplicationPolicy
   def unblock_email?
     staff?
   end
+
+  def review?
+    staff?
+  end
 end
diff --git a/app/policies/preview_card_policy.rb b/app/policies/preview_card_policy.rb
index 4f485d7fc..0410987e4 100644
--- a/app/policies/preview_card_policy.rb
+++ b/app/policies/preview_card_policy.rb
@@ -5,7 +5,7 @@ class PreviewCardPolicy < ApplicationPolicy
     staff?
   end
 
-  def update?
+  def review?
     staff?
   end
 end
diff --git a/app/policies/preview_card_provider_policy.rb b/app/policies/preview_card_provider_policy.rb
index 598d54a5e..44d2ad5cf 100644
--- a/app/policies/preview_card_provider_policy.rb
+++ b/app/policies/preview_card_provider_policy.rb
@@ -5,7 +5,7 @@ class PreviewCardProviderPolicy < ApplicationPolicy
     staff?
   end
 
-  def update?
+  def review?
     staff?
   end
 end
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb
index 6e9b840db..400f1ec79 100644
--- a/app/policies/status_policy.rb
+++ b/app/policies/status_policy.rb
@@ -41,6 +41,10 @@ class StatusPolicy < ApplicationPolicy
     staff? || owned?
   end
 
+  def review?
+    staff?
+  end
+
   private
 
   def requires_mention?
diff --git a/app/policies/tag_policy.rb b/app/policies/tag_policy.rb
index aaf70fcab..bdfcec0c9 100644
--- a/app/policies/tag_policy.rb
+++ b/app/policies/tag_policy.rb
@@ -12,4 +12,8 @@ class TagPolicy < ApplicationPolicy
   def update?
     staff?
   end
+
+  def review?
+    staff?
+  end
 end