extends the functionality of oauth in Stirling PDF
This commit is contained in:
@@ -47,6 +47,9 @@ public class User {
|
||||
@Column(name = "roleName")
|
||||
private String roleName;
|
||||
|
||||
@Column(name = "authenticationtype")
|
||||
private String authenticationType;
|
||||
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "user")
|
||||
private Set<Authority> authorities = new HashSet<>();
|
||||
|
||||
@@ -116,6 +119,14 @@ public class User {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public void setAuthenticationType(AuthenticationType authenticationType) {
|
||||
this.authenticationType = authenticationType.toString().toLowerCase();
|
||||
}
|
||||
|
||||
public String getAuthenticationType() {
|
||||
return authenticationType;
|
||||
}
|
||||
|
||||
public Set<Authority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
@@ -137,4 +148,8 @@ public class User {
|
||||
.map(Authority::getAuthority)
|
||||
.collect(Collectors.joining(", "));
|
||||
}
|
||||
|
||||
public boolean hasPassword() {
|
||||
return this.getPassword() != "" ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user