-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π :: User Entity #1
Conversation
public enum UserRole { | ||
STUDENT, TEACHER, ADMIN | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄κ±° GrantedAuthority implementsνκ³
public enum UserRole implements GrantedAuthority {
ROLE_ADMIN, ROLE_STUDENT, ROLE_TEACHER;
@Override
public String getAuthority() {
return name();
}
}
μ΄λ°μμΌλ‘ λ°κΏμΌ λ κ±°κ°μλ°?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GrantedAuthorityκ° μκ΅°?
6113cc6
@Enumerated(EnumType.STRING) | ||
private UserRole role; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ¬κΈ°λ
@Enumerated(EnumType.STRING)
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "Role", joinColumns = @JoinColumn(name = "id"))
private List<Role> roles = new ArrayList<>();
κ°μ
λμΆ© μ μ μν°ν°λ₯Ό λ§λ€μ΄λ³΄μμ΅λλ€
μμ μ¬ν
etc
"ν΄μ€"