Skip to content

Commit

Permalink
Merge pull request #7125 from skateman/sanitize-group-switch
Browse files Browse the repository at this point in the history
Do not allow the users to switch to a group that they don't belong to
  • Loading branch information
mzazrivec authored Jun 15, 2020
2 parents 89fd3e0 + 64bf2a7 commit 1db1f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def logout
def change_group
# Get the user and new group and set current_group in the user record
db_user = current_user
db_user.update(:current_group => MiqGroup.find_by(:id => params[:to_group]))
db_user.update(:current_group => db_user.miq_groups.find_by!(:id => params[:to_group]))

# Rebuild the session
session_reset
Expand Down

0 comments on commit 1db1f05

Please sign in to comment.