]> git.mxchange.org Git - addressbook-war.git/commitdiff
Allow this only as logged-in user
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 17:14:07 +0000 (19:14 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 17:16:28 +0000 (19:16 +0200)
src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java

index bf5e802e6af27662c896cc3ab66fc304bd5fca20..f81b2dbabbf82126c979036b02604e68f2ab768b 100644 (file)
@@ -132,11 +132,23 @@ public class AddressbookWebBean implements AddressbookWebController {
 
        @Override
        public List<Addressbook> 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<AddressbookEntry> 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);
        }