mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-25 05:44:13 -05:00
Muted users cannot transfer studio host
This commit is contained in:
parent
aecc9cec6e
commit
5d838ef659
2 changed files with 2 additions and 1 deletions
|
@ -59,6 +59,7 @@ const selectCanTransfer = (state, managerId) => {
|
||||||
// classroomId is loaded only for educator and admin users. Only educators can create class studios,
|
// 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.
|
// 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 (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 (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 (managerId === state.studio.owner) { // and the selected manager is the current owner/host,
|
||||||
if (isHost(state)) return true; // Owner/host can transfer
|
if (isHost(state)) return true; // Owner/host can transfer
|
||||||
|
|
|
@ -443,7 +443,7 @@ describe('studio members', () => {
|
||||||
['logged in', false],
|
['logged in', false],
|
||||||
['unconfirmed', false],
|
['unconfirmed', false],
|
||||||
['logged out', false],
|
['logged out', false],
|
||||||
['muted creator', true], // Muted users do not see the transfer UI
|
['muted creator', false],
|
||||||
['muted logged in', false]
|
['muted logged in', false]
|
||||||
])('%s: %s', (role, expected) => {
|
])('%s: %s', (role, expected) => {
|
||||||
setStateByRole(role);
|
setStateByRole(role);
|
||||||
|
|
Loading…
Reference in a new issue