From 6b833b78e8a51fda596e8d89a5d17f269d90f1f7 Mon Sep 17 00:00:00 2001 From: SepsiLaszlo Date: Sun, 23 Jun 2024 16:20:39 +0200 Subject: [PATCH] fix authorization for sub group principle update and destroy --- app/controllers/sub_group_principles_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/sub_group_principles_controller.rb b/app/controllers/sub_group_principles_controller.rb index 088e6f7e..6ff88017 100644 --- a/app/controllers/sub_group_principles_controller.rb +++ b/app/controllers/sub_group_principles_controller.rb @@ -14,7 +14,7 @@ def index def update @principle.attributes = principle_params - authorize @principle, policy_class: SubGroupPrinciplePolicy + authorize @principle.sub_group, policy_class: SubGroupPrinciplePolicy @principle.save! render 'principles/update' end @@ -34,8 +34,8 @@ def create end def destroy - authorize @principle, policy_class: SubGroupPrinciplePolicy - @principle.destroy + authorize @principle.sub_group, policy_class: SubGroupPrinciplePolicy + @principle.destroy! render 'principles/destroy' end