- do not ask moderator permissions if not guest or authenticated guest

This commit is contained in:
Richard Alam 2017-12-14 17:35:52 -08:00
parent 48548a7adc
commit 07e9f78730

View File

@ -306,35 +306,22 @@ public class Meeting {
public String calcGuestStatus(String role, Boolean guest, Boolean authned) {
if (GuestPolicy.ALWAYS_ACCEPT.equals(guestPolicy)) {
return GuestPolicy.ALLOW;
if (GuestPolicy.ALWAYS_ACCEPT.equals(guestPolicy)) {
return GuestPolicy.ALLOW;
} else if (GuestPolicy.ALWAYS_DENY.equals(guestPolicy)) {
return GuestPolicy.DENY;
}
if (ROLE_MODERATOR.equals(role.toUpperCase())) {
return GuestPolicy.ALLOW;
} else if (guest || ROLE_ATTENDEE.equals(role.toUpperCase())) {
String policy = getGuestPolicy();
switch (policy){
case GuestPolicy.ASK_MODERATOR:
return GuestPolicy.WAIT ;
case GuestPolicy.ALWAYS_ACCEPT:
return GuestPolicy.ALLOW ;
//Do not ask to join
case GuestPolicy.ALWAYS_ACCEPT_AUTH:
if (authned){
//If user is authenticated allow.
return GuestPolicy.ALLOW ;
}else{
//Else ask for permission
return GuestPolicy.WAIT ;
}
case GuestPolicy.ALWAYS_DENY:
return GuestPolicy.DENY;
return GuestPolicy.DENY;
} else if (GuestPolicy.ASK_MODERATOR.equals(guestPolicy)) {
if (guest || authned) {
return GuestPolicy.WAIT ;
}
return GuestPolicy.ALLOW;
} else if (GuestPolicy.ALWAYS_ACCEPT_AUTH.equals(guestPolicy)) {
if (guest){
// Only ask moderator for guests.
return GuestPolicy.WAIT ;
}
return GuestPolicy.ALLOW;
}
return GuestPolicy.DENY ;
}