diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 01bd2c4..83917e4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,6 +24,7 @@ private def pundit_user @pundit_user ||= ApplicationPolicy::Context.new( account: current_account, + params: params, ) end diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb index 06781a3..ae8931c 100644 --- a/app/policies/application_policy.rb +++ b/app/policies/application_policy.rb @@ -50,6 +50,10 @@ private context&.account end + def params + context&.params + end + def restricted? Rails.application.restricted? end @@ -76,16 +80,21 @@ private context&.account end + def params + context&.params + end + def restricted? Rails.application.restricted? end end class Context - attr_reader :account + attr_reader :account, :params - def initialize(account:) + def initialize(account:, params:) @account = account + @params = params end end end