From 02137ec0998e3dc43b309d837361339ff14da26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Tue, 22 Aug 2023 08:50:33 +0200 Subject: [PATCH] Bugfix all API Impot particulier permitted scopes Same as 72a45eedd93b31bcf43c5028391bf048b0d636c4 --- .../enrollment/api_impot_particulier_unique_policy.rb | 6 ++++-- backend/app/policies/enrollment/api_sfip_sandbox_policy.rb | 6 ++++-- backend/app/policies/enrollment/api_sfip_unique_policy.rb | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/app/policies/enrollment/api_impot_particulier_unique_policy.rb b/backend/app/policies/enrollment/api_impot_particulier_unique_policy.rb index 9e1ad42d8..5966aaa5c 100644 --- a/backend/app/policies/enrollment/api_impot_particulier_unique_policy.rb +++ b/backend/app/policies/enrollment/api_impot_particulier_unique_policy.rb @@ -4,8 +4,10 @@ class Enrollment::ApiImpotParticulierUniquePolicy < Enrollment::UniquePolicy def permitted_attributes res = super - res[:scopes] = impot_particulier_permitted_scopes - augment_permitted_attributes(res, :additional_content, *impot_particulier_permitted_acces) + res.concat([ + scopes: impot_particulier_permitted_scopes + ]) + res end end diff --git a/backend/app/policies/enrollment/api_sfip_sandbox_policy.rb b/backend/app/policies/enrollment/api_sfip_sandbox_policy.rb index 7673c05d7..c418f7e12 100644 --- a/backend/app/policies/enrollment/api_sfip_sandbox_policy.rb +++ b/backend/app/policies/enrollment/api_sfip_sandbox_policy.rb @@ -6,8 +6,10 @@ class Enrollment::ApiSfipSandboxPolicy < Enrollment::SandboxPolicy def permitted_attributes res = super - res[:scopes] = impot_particulier_permitted_scopes - augment_permitted_attributes(res, :additional_content, *impot_particulier_permitted_acces) + res.concat([ + scopes: impot_particulier_permitted_scopes + ]) + res end end diff --git a/backend/app/policies/enrollment/api_sfip_unique_policy.rb b/backend/app/policies/enrollment/api_sfip_unique_policy.rb index f1c4ff99b..14744f145 100644 --- a/backend/app/policies/enrollment/api_sfip_unique_policy.rb +++ b/backend/app/policies/enrollment/api_sfip_unique_policy.rb @@ -6,8 +6,10 @@ class Enrollment::ApiSfipUniquePolicy < Enrollment::UniquePolicy def permitted_attributes res = super - res[:scopes] = impot_particulier_permitted_scopes - augment_permitted_attributes(res, :additional_content, *impot_particulier_permitted_acces) + res.concat([ + scopes: impot_particulier_permitted_scopes + ]) + res end end