Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
5d838ef6
Commit
5d838ef6
authored
Aug 24, 2021
by
Eric Rosenbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Muted users cannot transfer studio host
parent
aecc9cec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
src/redux/studio-permissions.js
src/redux/studio-permissions.js
+1
-0
test/unit/redux/studio-permissions.test.js
test/unit/redux/studio-permissions.test.js
+1
-1
No files found.
src/redux/studio-permissions.js
View file @
5d838ef6
...
@@ -59,6 +59,7 @@ const selectCanTransfer = (state, managerId) => {
...
@@ -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
...
...
test/unit/redux/studio-permissions.test.js
View file @
5d838ef6
...
@@ -443,7 +443,7 @@ describe('studio members', () => {
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment