|
|
@@ -17,22 +17,34 @@ public abstract class WebSecurityConstants {
|
|
|
public static final String STUDENT_ROLE = "STUDENT";
|
|
|
public static final String TEACHER_ROLE = "TEACHER";
|
|
|
public static final String ADMIN_ROLE = "ADMIN";
|
|
|
-
|
|
|
+ public static final String STAFF_ROLE = "STAFF";
|
|
|
+ public static final String HR_ROLE = "HR";
|
|
|
+ public static final String SEEC_ROLE = "SEEC";
|
|
|
+ public static final String SEECX_ROLE = "SEECX";
|
|
|
+
|
|
|
public static final GrantedAuthority STUDENT_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + STUDENT_ROLE);
|
|
|
public static final GrantedAuthority TEACHER_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + TEACHER_ROLE);
|
|
|
public static final GrantedAuthority ADMIN_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + ADMIN_ROLE);
|
|
|
+ public static final GrantedAuthority STAFF_AUTHORITY = new SimpleGrantedAuthority(ROLE_PREFIX + STAFF_ROLE);
|
|
|
+ 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);
|
|
|
|
|
|
|
|
|
|
|
|
private static final Map<UserIdentity,GrantedAuthority> authorityTable= new HashMap<>();
|
|
|
-
|
|
|
+
|
|
|
static {
|
|
|
authorityTable.put(UserIdentity.STUDENT, STUDENT_AUTHORITY);
|
|
|
authorityTable.put(UserIdentity.TEACHER, TEACHER_AUTHORITY);
|
|
|
authorityTable.put(UserIdentity.ADMIN, ADMIN_AUTHORITY);
|
|
|
+ authorityTable.put(UserIdentity.STAFF, STAFF_AUTHORITY);
|
|
|
+ authorityTable.put(UserIdentity.HR, HR_AUTHORITY);
|
|
|
+ authorityTable.put(UserIdentity.SEEC, SEEC_AUTHORITY);
|
|
|
+ authorityTable.put(UserIdentity.SEECX, SEECX_AUTHORITY);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static GrantedAuthority getAuthority(UserIdentity identity){
|
|
|
return authorityTable.get(identity);
|
|
|
}
|
|
|
-}
|
|
|
+}
|