Fix change of sharing repository settings [SCI-10428] (#7294)

This commit is contained in:
ajugo 2024-03-18 09:37:36 +01:00 committed by GitHub
parent 2ec88410e3
commit fd5ed15003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,7 @@ class TeamRepositoriesController < ApplicationController
end
def update_params
params.permit(:permission_changes, share_team_ids: [], write_permissions: [])
params.permit(permission_changes: {}, share_team_ids: [], write_permissions: [])
end
def check_sharing_permissions
@ -79,7 +79,7 @@ class TeamRepositoriesController < ApplicationController
def teams_to_update
return [] if update_params[:permission_changes].blank?
teams_to_update = JSON.parse(update_params[:permission_changes]).keys.map(&:to_i).to_a &
teams_to_update = update_params[:permission_changes].keys.map(&:to_i).to_a &
update_params[:share_team_ids]&.map(&:to_i).to_a
wp = update_params[:write_permissions]&.map(&:to_i)