about summary refs log tree commit diff
path: root/app/controllers/api/v1/admin/retention_controller.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-07-17 23:10:31 +0200
committerGitHub <noreply@github.com>2022-07-17 23:10:31 +0200
commitab1488a6ad93f572e1d184cb9653f76fd408474f (patch)
treef1dd126f4745eb99243f390169fb957a72f5acc6 /app/controllers/api/v1/admin/retention_controller.rb
parent325ebb76b19bd20e1b76d8bc26c11cab02f6571c (diff)
parent6c0d73a675d62f676b005c06593fd69e9a7bc0e5 (diff)
Merge pull request #1804 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/api/v1/admin/retention_controller.rb')
-rw-r--r--app/controllers/api/v1/admin/retention_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/api/v1/admin/retention_controller.rb b/app/controllers/api/v1/admin/retention_controller.rb
index 98d1a3d81..59d6b8388 100644
--- a/app/controllers/api/v1/admin/retention_controller.rb
+++ b/app/controllers/api/v1/admin/retention_controller.rb
@@ -1,11 +1,15 @@
 # frozen_string_literal: true
 
 class Api::V1::Admin::RetentionController < Api::BaseController
+  include Authorization
+
   before_action -> { authorize_if_got_token! :'admin:read' }
-  before_action :require_staff!
   before_action :set_cohorts
 
+  after_action :verify_authorized
+
   def create
+    authorize :dashboard, :index?
     render json: @cohorts, each_serializer: REST::Admin::CohortSerializer
   end