From c13e5af0613213660a757273cfa04c10c2cae3f4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 19:14:07 +0200 Subject: [PATCH] Allow this only as logged-in user --- .../beans/addressbook/AddressbookWebBean.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java index bf5e802e..f81b2dba 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -132,11 +132,23 @@ public class AddressbookWebBean implements AddressbookWebController { @Override public List allAddressbooks () { + // Is the user logged in? + if (!this.loginController.isUserLoggedIn()) { + // Not logged in + throw new FaceletException("This method can only be called as logged-in user."); //NOI18N + } + return Collections.unmodifiableList(this.addressbookList); } @Override public List allEntries (final Addressbook addressbook) { + // Is the user logged in? + if (!this.loginController.isUserLoggedIn()) { + // Not logged in + throw new FaceletException("This method can only be called as logged-in user."); //NOI18N + } + // Ask the bean return this.addressbookBean.allEntries(addressbook); } -- 2.39.5