Skip to content

Commit 77d1dcf

Browse files
authored
Merge pull request #5772 from nhsuk/index-policy-school-moves-consent-forms
Don't skip `verify_authorized` on `index`
2 parents 3aa6867 + 009bdfe commit 77d1dcf

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

app/controllers/consent_forms_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ class ConsentFormsController < ApplicationController
88
before_action :set_patient, only: %i[edit_match update_match]
99
before_action :set_search_params_present, only: :search
1010

11-
skip_after_action :verify_authorized, only: :index
1211
skip_after_action :verify_policy_scoped, only: :search
1312

1413
def index
14+
authorize ConsentForm
15+
1516
consent_forms = policy_scope(ConsentForm).unmatched.order(:recorded_at)
1617

1718
if (session_slug = params[:session_slug]).present?

app/controllers/school_moves_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class SchoolMovesController < ApplicationController
77
before_action :set_school_move, except: :index
88
before_action :set_patient, except: :index
99

10-
skip_after_action :verify_authorized, only: :index
11-
1210
layout "full"
1311

1412
def index
13+
authorize SchoolMove
14+
1515
school_moves =
1616
policy_scope(SchoolMove).includes(
1717
:team,

0 commit comments

Comments
 (0)