mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 22:21:09 +08:00
Add role-based authorization
This commit is contained in:
6
src/main/java/com/openisle/model/Role.java
Normal file
6
src/main/java/com/openisle/model/Role.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.openisle.model;
|
||||
|
||||
public enum Role {
|
||||
ADMIN,
|
||||
USER
|
||||
}
|
||||
@@ -5,6 +5,12 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import com.openisle.model.Role;
|
||||
|
||||
/**
|
||||
* Simple user entity with basic fields and a role.
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -28,4 +34,8 @@ public class User {
|
||||
private boolean verified = false;
|
||||
|
||||
private String verificationCode;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(nullable = false)
|
||||
private Role role = Role.USER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user