List of usage examples for org.apache.wicket.markup.html WebMarkupContainer getSession
public Session getSession()
From source file:org.geoserver.web.DefaultGeoServerNodeInfo.java
License:Open Source License
/** * The element is visible if an admin is logged in, and the id is not null * @param parent/*w w w . ja va 2 s. c o m*/ * @return */ protected boolean isNodeIdVisible(WebMarkupContainer parent) { if (NODE_ID == null) { return false; } // we don't show the node id to all users, only to the admin Authentication auth = ((GeoServerSession) parent.getSession()).getAuthentication(); if (auth == null || !auth.isAuthenticated() || auth instanceof AnonymousAuthenticationToken) { return false; } else { GeoServerSecurityManager securityManager = GeoServerApplication.get().getSecurityManager(); return securityManager.checkAuthenticationForAdminRole(auth); } }