package cn.zyp.stusystem.constant; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; // constant/PermissionConstants.java public class PermissionConstants { public static final String ROLE_ADMIN = "admin"; public static final String ROLE_HEAD_TEACHER = "head_teacher"; public static final String ROLE_TEACHER = "teacher"; public static final String CLASS_VIEW = "class:view"; public static final String CLASS_ADD = "class:add"; public static final String CLASS_EDIT = "class:edit"; public static final String CLASS_DELETE = "class:delete"; public static final String STUDENT_VIEW = "student:view"; public static final String STUDENT_ADD = "student:add"; public static final String STUDENT_EDIT = "student:edit"; public static final String STUDENT_DELETE = "student:delete"; public static final Map> ROLE_PERMISSIONS = new HashMap<>(); static { ROLE_PERMISSIONS.put(ROLE_ADMIN, Arrays.asList( CLASS_VIEW, CLASS_ADD, CLASS_EDIT, CLASS_DELETE, STUDENT_VIEW, STUDENT_ADD, STUDENT_EDIT, STUDENT_DELETE )); ROLE_PERMISSIONS.put(ROLE_HEAD_TEACHER, Arrays.asList( CLASS_VIEW, STUDENT_VIEW, STUDENT_ADD, STUDENT_EDIT, STUDENT_DELETE )); ROLE_PERMISSIONS.put(ROLE_TEACHER, Arrays.asList( CLASS_VIEW, STUDENT_VIEW )); } }