Project

General

Profile

Revision ee671da1

IDee671da1d104ea57b728ef6a7f8f7a5e61b3f40c
Parent 16c32ddd
Child 1e7845ad

Added by Andreas Kohlbecker over 2 years ago

extending userHelper by method to access the current user

View differences:

src/main/java/eu/etaxonomy/cdm/service/CdmUserHelper.java
94 94
    }
95 95

  
96 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

  
105
    @Override
97 106
    public String userName() {
98 107
        Authentication authentication = getAuthentication();
99 108
        if(authentication != null) {
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

Add picture from clipboard (Maximum size: 40 MB)