Selaa lähdekoodia

fix: 添加”助教“角色

zhaoxingrui 4 vuotta sitten
vanhempi
commit
8d83ee14c8

+ 3 - 0
web/src/main/java/cn/seecoder/web/infrastructure/security/WebSecurityConstants.java

@@ -21,6 +21,7 @@ public abstract class WebSecurityConstants {
 	public static final String HR_ROLE = "HR";
 	public static final String SEEC_ROLE = "SEEC";
 	public static final String SEECX_ROLE = "SEECX";
+	public static final String ASSISTANT_ROLE = "ASSISTANT";
 
 	public static final GrantedAuthority STUDENT_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + STUDENT_ROLE);
 	public static final GrantedAuthority TEACHER_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + TEACHER_ROLE);
@@ -29,6 +30,7 @@ public abstract class WebSecurityConstants {
 	public static final GrantedAuthority HR_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + HR_ROLE);
 	public static final GrantedAuthority SEEC_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + SEEC_ROLE);
 	public static final GrantedAuthority SEECX_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + SEECX_ROLE);
+	public static final GrantedAuthority ASSISTANT_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + ASSISTANT_ROLE);
 
 
 
@@ -42,6 +44,7 @@ public abstract class WebSecurityConstants {
 		authorityTable.put(UserIdentity.HR, HR_AUTHORITY);
 		authorityTable.put(UserIdentity.SEEC, SEEC_AUTHORITY);
 		authorityTable.put(UserIdentity.SEECX, SEECX_AUTHORITY);
+		authorityTable.put(UserIdentity.ASSISTANT, ASSISTANT_AUTHORITY);
 	}
 
 	public static GrantedAuthority getAuthority(UserIdentity identity){

+ 4 - 1
web/src/main/java/cn/seecoder/web/model/enums/UserIdentity.java

@@ -23,7 +23,10 @@ public enum UserIdentity {
     SEEC("SEEC"),
 
     @JsonProperty("SEECX")
-    SEECX("SEECX");
+    SEECX("SEECX"),
+
+	@JsonProperty("ASSISTANT")
+    ASSISTANT("ASSISTANT");
 
 	private final String name;