Security Matrix - Restricting visibility to Assigned To and Created By

Hi All,

Is there a way I can setup a security matrix where cases of Team A are visible/editable only to Assigned To and Created By, but cases of other teams can be visible/editable to all the respective team members.

Regards,

Yogesh