diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index 79452ecdae..0a53086f3f 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -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 ; }