Let $M_d(\mathbb{C})$ denote the algebra of $d \times d$ complex matrices. Consider the algebra
$$\mathcal{A} = \bigoplus_{i=1}^r I_{d_i} \otimes M_{d_i}(\mathbb{C})$$
for some choice of $d_1, \ldots, d_r \in \mathbb{N}$. Then a unitary matrix $U$ satisfies $UXU^\dagger \in \mathcal{A}$ for all $X \in \mathcal{A}$ if and only if
$$U = P \left(\bigoplus_{I=1}^r M_i \otimes N_i\right)$$
where $M_i, N_i \in M_{d_i}(\mathbb{C})$ are unitaries for each $i = 1, \ldots, r$, and $P$ is a permutation matrix that permutes summands in the direct sum but only so that summands of the same dimension can be permuted among one another.
Question: Is there a convenient reference for this fact that I can use?