fixed use of non-accessible exception

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2024-03-15 13:35:39 +01:00
parent 0a1e210503
commit 745ce65a75

View File

@@ -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();