From: Roland Haeder Date: Mon, 12 Oct 2015 17:14:07 +0000 (+0200) Subject: Allow this only as logged-in user X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c13e5af0613213660a757273cfa04c10c2cae3f4;p=addressbook-war.git Allow this only as logged-in user --- 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); }