Browse Source

fixed use of non-accessible exception

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
main
Stephan Richter 8 months ago
parent
commit
745ce65a75
  1. 3
      src/main/java/de/srsoftware/widerhall/web/Rest.java

3
src/main/java/de/srsoftware/widerhall/web/Rest.java

@ -13,7 +13,6 @@ import javax.servlet.ServletException; @@ -13,7 +13,6 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.NotAllowedException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
@ -67,7 +66,7 @@ public class Rest extends HttpServlet { @@ -67,7 +66,7 @@ public class Rest extends HttpServlet {
var list = Util.getMailingList(req);
if (list == null) throw new IllegalArgumentException(t("You are trying to access a non-existing list!"));
var allowed = list.hasPublicArchive() || list.mayBeAlteredBy(user);
if (!allowed) throw new NotAllowedException(t("You are not allowed to access the archive of this list!"));
if (!allowed) throw new IllegalAccessError(t("You are not allowed to access the archive of this list!"));
var allEmails = user != null || list.hasState(STATE_OPEN_FOR_SUBSCRIBERS) || list.hasState(STATE_OPEN_FOR_GUESTS);
var limitedSenders = allEmails ? null : list.moderators().map(ListMember::user).map(User::email).toList();

Loading…
Cancel
Save