Revision be1478a2
Added by Alexander Oppermann almost 9 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/HorizontalToolbar.java | ||
---|---|---|
6 | 6 |
import org.springframework.security.core.context.SecurityContext; |
7 | 7 |
import org.springframework.security.core.context.SecurityContextHolder; |
8 | 8 |
|
9 |
import com.vaadin.server.Page; |
|
9 | 10 |
import com.vaadin.server.ThemeResource; |
11 |
import com.vaadin.server.VaadinServlet; |
|
10 | 12 |
import com.vaadin.server.VaadinSession; |
11 | 13 |
import com.vaadin.ui.Alignment; |
12 | 14 |
import com.vaadin.ui.Button; |
... | ... | |
17 | 19 |
import com.vaadin.ui.Label; |
18 | 20 |
import com.vaadin.ui.UI; |
19 | 21 |
|
22 |
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinAuthentication; |
|
23 |
|
|
20 | 24 |
public class HorizontalToolbar extends HorizontalLayout implements Serializable{ |
21 | 25 |
|
22 | 26 |
|
... | ... | |
40 | 44 |
// private ExcelExporter exporter = new ExcelExporter(); |
41 | 45 |
|
42 | 46 |
public HorizontalToolbar() { |
43 |
authentication = (Authentication) VaadinSession.getCurrent().getAttribute("authentication"); |
|
47 |
// authentication = (Authentication) VaadinSession.getCurrent().getAttribute("authentication"); |
|
48 |
CdmVaadinAuthentication authentication = (CdmVaadinAuthentication) VaadinSession.getCurrent().getAttribute(CdmVaadinAuthentication.KEY); |
|
49 |
this.authentication = authentication.getAuthentication(Page.getCurrent().getLocation(), VaadinServlet.getCurrent().getServletContext().getContextPath()); |
|
44 | 50 |
init(); |
45 | 51 |
} |
46 | 52 |
|
Also available in: Unified diff
Fixed problem for toolbar and new authentification object. Added getter method to CdmVaadinAuthentication, in order to get the principal object with user name and roles.