Project

General

Profile

« Previous | Next » 

Revision ee671da1

Added by Andreas Kohlbecker about 6 years ago

extending userHelper by method to access the current user

View differences:

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();

Also available in: Unified diff