From c7f175b71b66bba857c69dc53e893317f14f212e Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Wed, 25 Sep 2024 14:28:32 +0200 Subject: [PATCH] Fix team sharing logic [SCI-11102] --- app/controllers/team_shared_objects_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/team_shared_objects_controller.rb b/app/controllers/team_shared_objects_controller.rb index 4914b7614..c3cbb65f9 100644 --- a/app/controllers/team_shared_objects_controller.rb +++ b/app/controllers/team_shared_objects_controller.rb @@ -33,6 +33,8 @@ class TeamSharedObjectsController < ApplicationController # Share to specific teams params[:team_share_params].each do |t| + next unless t['private_shared_with'] + @model.update!(permission_level: :not_shared) if @model.globally_shareable? team_shared_object = @model.team_shared_objects.find_or_initialize_by(team_id: t['id'])