Skip to content

Commit

Permalink
Use User#permitted_params in Users::RolesController#user_params
Browse files Browse the repository at this point in the history
To further simplify the method, c.f. this commit [1] where
User#permitted_params was introduced.

[1]: 09ff60d
  • Loading branch information
floehopper committed Nov 22, 2023
1 parent 306c27c commit 1633d09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/controllers/users/roles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def authorize_user
end

def user_params
permitted_user_params = current_user.role_class.permitted_user_params
params.require(:user).permit(*permitted_user_params.intersection([:role]))
params.require(:user).permit(*current_user.permitted_params.intersection([:role]))
end

def redirect_to_account_page_if_acting_on_own_user
Expand Down

0 comments on commit 1633d09

Please sign in to comment.