-
Notifications
You must be signed in to change notification settings - Fork 2
/
user.java
49 lines (40 loc) · 1.02 KB
/
user.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
public class MyUser implements UserDetails {
private String name;
private List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
private KDEConduitUser(name) {
super();
this.name = name;
authorities.add(SecurityRealm.AUTHENTICATED_AUTHORITY);
}
public void addAuthority(GrantedAuthority authority) {
authorities.add(authority);
}
@Override
public GrantedAuthority[] getAuthorities() {
return authorities.toArray(new GrantedAuthority[authorities.size()]);
}
@Override
public String getPassword() {
return null;
}
@Override
public String getUsername() {
return name;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}