From 21c4456f647952dd99e9b45d607cc004c00eeb30 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 16 Oct 2015 13:36:30 +0200 Subject: [PATCH] =?utf8?q?init()=20doesn't=20work=20with=20guests,=20so=20?= =?utf8?q?forbid=20it=20here=20+=20used=20address=20book=20instance=20from?= =?utf8?q?=20"share"=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/addressbook/beans/shares/SharesWebBean.java | 6 ++++++ web/login/login_shared_addressbooks.xhtml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/addressbook/beans/shares/SharesWebBean.java b/src/java/org/mxchange/addressbook/beans/shares/SharesWebBean.java index 288e4c4a..bfb768d3 100644 --- a/src/java/org/mxchange/addressbook/beans/shares/SharesWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/shares/SharesWebBean.java @@ -185,6 +185,12 @@ public class SharesWebBean implements SharesWebController { @PostConstruct public void init () { + // Check conditions + if (!this.loginController.isUserLoggedIn()) { + // No, then throw exception + throw new FaceletException("This method can only be called as logged-in user."); //NOI18N + } + // Init share list this.sharedAddressbooks = this.shareBean.allSharedAddressbooks(this.loginController.getLoggedInUser()); } diff --git a/web/login/login_shared_addressbooks.xhtml b/web/login/login_shared_addressbooks.xhtml index ed84ff92..2f6ba09a 100644 --- a/web/login/login_shared_addressbooks.xhtml +++ b/web/login/login_shared_addressbooks.xhtml @@ -25,7 +25,7 @@ #{msg.SHARED_ADDRESSBOOK} - + -- 2.39.5