Changeset 5592 for VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.java
- Timestamp:
- 08/22/14 08:16:18 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.java
r5576 r5592 15 15 16 16 public class BasePage extends WebPage { 17 17 18 18 @SpringBean 19 19 private AdminUsersService adminUsersService; 20 20 21 21 protected BasePage(IModel<?> model) { 22 22 super(model); … … 39 39 AdminPage.class)); 40 40 add(menu); 41 41 42 42 add(new FeedbackPanel("feedback")); 43 43 44 44 add(new BookmarkablePageLink("homelink", getApplication().getHomePage()) 45 45 .setAutoEnable(false)); 46 add(new BookmarkablePageLink("aboutlink", AboutPage.class) 47 .setAutoEnable(false)); 48 46 49 } 47 50 48 51 protected BasePage() { 49 52 this(null); 50 53 } 51 54 52 55 @Override 53 56 protected void onBeforeRender() { … … 82 85 super.onBeforeRender(); 83 86 } 84 87 85 88 protected Principal getUser() { 86 89 ApplicationSession session = (ApplicationSession) getSession(); … … 91 94 return principal; 92 95 } 93 96 94 97 protected boolean isUserAdmin() { 95 98 final String userName = getUser().getName(); 96 99 return userName != null && adminUsersService.isAdmin(userName); 97 100 } 98 101 99 102 @Override 100 103 public ApplicationSession getSession() { 101 104 return (ApplicationSession) super.getSession(); 102 105 } 103 106 104 107 } // class BasePage
Note: See TracChangeset
for help on using the changeset viewer.