mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-06-27 04:21:18 -04:00
Merge pull request #9488 from scratchfoundation/hotfix/disallow-students-from-inviting-curators
[Master] Hotfix/disallow students from inviting curators
This commit is contained in:
commit
b46c2cb0cb
2 changed files with 6 additions and 2 deletions
src/redux
|
@ -157,6 +157,7 @@ module.exports.selectIsAdmin = state => get(state, ['session', 'session', 'permi
|
||||||
module.exports.selectUser = state => get(state, ['session', 'session', 'user'], false);
|
module.exports.selectUser = state => get(state, ['session', 'session', 'user'], false);
|
||||||
module.exports.selectIsSocial = state => get(state, ['session', 'session', 'permissions', 'social'], false);
|
module.exports.selectIsSocial = state => get(state, ['session', 'session', 'permissions', 'social'], false);
|
||||||
module.exports.selectIsEducator = state => get(state, ['session', 'session', 'permissions', 'educator'], false);
|
module.exports.selectIsEducator = state => get(state, ['session', 'session', 'permissions', 'educator'], false);
|
||||||
|
module.exports.selectIsStudent = state => get(state, ['session', 'session', 'permissions', 'student'], false);
|
||||||
module.exports.selectProjectCommentsGloballyEnabled = state =>
|
module.exports.selectProjectCommentsGloballyEnabled = state =>
|
||||||
get(state, ['session', 'session', 'flags', 'project_comments_enabled'], false);
|
get(state, ['session', 'session', 'flags', 'project_comments_enabled'], false);
|
||||||
module.exports.selectStudioCommentsGloballyEnabled = state =>
|
module.exports.selectStudioCommentsGloballyEnabled = state =>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const {selectUserId, selectIsAdmin, selectIsSocial,
|
const {selectUserId, selectIsAdmin, selectIsSocial,
|
||||||
selectIsLoggedIn, selectUsername, selectIsMuted,
|
selectIsLoggedIn, selectUsername, selectIsMuted,
|
||||||
selectHasFetchedSession, selectStudioCommentsGloballyEnabled} = require('./session');
|
selectHasFetchedSession, selectStudioCommentsGloballyEnabled,
|
||||||
|
selectIsStudent} = require('./session');
|
||||||
|
|
||||||
// Fine-grain selector helpers - not exported, use the higher level selectors below
|
// Fine-grain selector helpers - not exported, use the higher level selectors below
|
||||||
const isHost = state => selectUserId(state) === state.studio.host;
|
const isHost = state => selectUserId(state) === state.studio.host;
|
||||||
|
@ -39,7 +40,9 @@ const selectCanEditCommentsAllowed = state => !selectIsMuted(state) && (selectIs
|
||||||
const selectCanEditOpenToAll = state => !selectIsMuted(state) && isManager(state);
|
const selectCanEditOpenToAll = state => !selectIsMuted(state) && isManager(state);
|
||||||
|
|
||||||
const selectShowCuratorInvite = state => !selectIsMuted(state) && !!state.studio.invited;
|
const selectShowCuratorInvite = state => !selectIsMuted(state) && !!state.studio.invited;
|
||||||
const selectCanInviteCurators = state => !selectIsMuted(state) && isManager(state);
|
// Students should not be able to create studios, this is to address already existing ones.
|
||||||
|
// See https://scratchfoundation.atlassian.net/browse/POD-220
|
||||||
|
const selectCanInviteCurators = state => !selectIsMuted(state) && !selectIsStudent(state) && isManager(state);
|
||||||
const selectCanRemoveCurator = (state, username) => {
|
const selectCanRemoveCurator = (state, username) => {
|
||||||
if (selectIsMuted(state)) return false;
|
if (selectIsMuted(state)) return false;
|
||||||
// Admins/managers can remove any curators
|
// Admins/managers can remove any curators
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue