From 745ce65a7553227e9a3f0380eb7e35780e0f8b25 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Fri, 15 Mar 2024 13:35:39 +0100 Subject: [PATCH] fixed use of non-accessible exception Signed-off-by: Stephan Richter --- src/main/java/de/srsoftware/widerhall/web/Rest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/srsoftware/widerhall/web/Rest.java b/src/main/java/de/srsoftware/widerhall/web/Rest.java index c813f70..6ccfc42 100644 --- a/src/main/java/de/srsoftware/widerhall/web/Rest.java +++ b/src/main/java/de/srsoftware/widerhall/web/Rest.java @@ -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 { 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();