Show the user roles as real names (#867)

* Show the user roles as real names

* Add error message

* Update Role.java

* default Language without translation

* Update messages_el_GR.properties
This commit is contained in:
Ludy
2024-03-06 23:14:02 +01:00
committed by GitHub
parent ece1d071c0
commit 97472310f2
32 changed files with 166 additions and 17 deletions

View File

@@ -44,6 +44,9 @@ public class User {
@Column(name = "isFirstLogin")
private Boolean isFirstLogin = false;
@Column(name = "roleName")
private String roleName;
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "user")
private Set<Authority> authorities = new HashSet<>();
@@ -53,6 +56,10 @@ public class User {
@CollectionTable(name = "user_settings", joinColumns = @JoinColumn(name = "user_id"))
private Map<String, String> settings = new HashMap<>(); // Key-value pairs of settings.
public String getRoleName() {
return Role.getRoleNameByRoleId(getRolesAsString());
}
public boolean isFirstLogin() {
return isFirstLogin != null && isFirstLogin;
}