From 5d838ef6593017e921f94354cc1fd383f4e1e83f Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 24 Aug 2021 14:36:06 -0400 Subject: [PATCH] Muted users cannot transfer studio host --- src/redux/studio-permissions.js | 1 + test/unit/redux/studio-permissions.test.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redux/studio-permissions.js b/src/redux/studio-permissions.js index 99b75f9d9..3895d044c 100644 --- a/src/redux/studio-permissions.js +++ b/src/redux/studio-permissions.js @@ -59,6 +59,7 @@ const selectCanTransfer = (state, managerId) => { // classroomId is loaded only for educator and admin users. Only educators can create class studios, // so educators and admins are the only users who otherwise would be able to transfer a class studio. if (state.studio.classroomId !== null) return false; + if (selectIsMuted(state)) return false; // Muted users cannot transfer studios. if (state.studio.managers > 1) { // If there is more than one manager, if (managerId === state.studio.owner) { // and the selected manager is the current owner/host, if (isHost(state)) return true; // Owner/host can transfer diff --git a/test/unit/redux/studio-permissions.test.js b/test/unit/redux/studio-permissions.test.js index 994cdafb1..8753b953a 100644 --- a/test/unit/redux/studio-permissions.test.js +++ b/test/unit/redux/studio-permissions.test.js @@ -443,7 +443,7 @@ describe('studio members', () => { ['logged in', false], ['unconfirmed', false], ['logged out', false], - ['muted creator', true], // Muted users do not see the transfer UI + ['muted creator', false], ['muted logged in', false] ])('%s: %s', (role, expected) => { setStateByRole(role);