New option for handling permissions in rooms. Set allowWhenRoleMissing to permit actions before a peer with that permission joins. Ref #303
This commit is contained in:
@@ -33,18 +33,8 @@ const initialState =
|
||||
closeMeetingInProgress : false,
|
||||
clearChatInProgress : false,
|
||||
clearFileSharingInProgress : false,
|
||||
userRoles : { NORMAL: 'normal' }, // Default role
|
||||
permissionsFromRoles : {
|
||||
CHANGE_ROOM_LOCK : [],
|
||||
PROMOTE_PEER : [],
|
||||
SEND_CHAT : [],
|
||||
MODERATE_CHAT : [],
|
||||
SHARE_SCREEN : [],
|
||||
EXTRA_VIDEO : [],
|
||||
SHARE_FILE : [],
|
||||
MODERATE_FILES : [],
|
||||
MODERATE_ROOM : []
|
||||
}
|
||||
roomPermissions : null,
|
||||
allowWhenRoleMissing : null
|
||||
};
|
||||
|
||||
const room = (state = initialState, action) =>
|
||||
@@ -240,18 +230,18 @@ const room = (state = initialState, action) =>
|
||||
case 'CLEAR_FILE_SHARING_IN_PROGRESS':
|
||||
return { ...state, clearFileSharingInProgress: action.payload.flag };
|
||||
|
||||
case 'SET_USER_ROLES':
|
||||
case 'SET_ROOM_PERMISSIONS':
|
||||
{
|
||||
const { userRoles } = action.payload;
|
||||
const { roomPermissions } = action.payload;
|
||||
|
||||
return { ...state, userRoles };
|
||||
return { ...state, roomPermissions };
|
||||
}
|
||||
|
||||
case 'SET_PERMISSIONS_FROM_ROLES':
|
||||
case 'SET_ALLOW_WHEN_ROLE_MISSING':
|
||||
{
|
||||
const { permissionsFromRoles } = action.payload;
|
||||
const { allowWhenRoleMissing } = action.payload;
|
||||
|
||||
return { ...state, permissionsFromRoles };
|
||||
return { ...state, allowWhenRoleMissing };
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user