Skip to content

Commit

Permalink
Merge pull request #439 from kir-dev/fix-sub-group-principle-create-a…
Browse files Browse the repository at this point in the history
…nd-update

fix authorization for sub group principle update and destroy
  • Loading branch information
SepsiLaszlo authored Jun 23, 2024
2 parents affb031 + 6b833b7 commit a8cfd0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/sub_group_principles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a8cfd0e

Please sign in to comment.