Revision ee671da1
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/service/CdmUserHelper.java | ||
---|---|---|
93 | 93 |
&& authentication instanceof AnonymousAuthenticationToken; |
94 | 94 |
} |
95 | 95 |
|
96 |
@Override |
|
97 |
public User user() { |
|
98 |
Authentication authentication = getAuthentication(); |
|
99 |
if(authentication != null && authentication.getPrincipal() != null) { |
|
100 |
return (User) authentication.getPrincipal(); |
|
101 |
} |
|
102 |
return null; |
|
103 |
} |
|
104 |
|
|
96 | 105 |
@Override |
97 | 106 |
public String userName() { |
98 | 107 |
Authentication authentication = getAuthentication(); |
src/main/java/eu/etaxonomy/cdm/vaadin/security/UserHelper.java | ||
---|---|---|
13 | 13 |
import com.vaadin.server.VaadinSession; |
14 | 14 |
|
15 | 15 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
16 |
import eu.etaxonomy.cdm.model.common.User; |
|
16 | 17 |
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD; |
17 | 18 |
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority; |
18 | 19 |
|
... | ... | |
48 | 49 |
|
49 | 50 |
boolean userIsAdmin(); |
50 | 51 |
|
52 |
User user(); |
|
53 |
|
|
51 | 54 |
String userName(); |
52 | 55 |
|
53 | 56 |
boolean userIsAnnonymous(); |
Also available in: Unified diff
extending userHelper by method to access the current user