add store

This commit is contained in:
Timi
2026-08-07 11:37:54 +08:00
parent 7ffdd715ee
commit 7e40e0202e
60 changed files with 1657 additions and 446 deletions
@@ -192,6 +192,7 @@ public class InitBuiltinUser implements ApplicationRunner {
private void bindBuiltinPermission(Map<String, Role> roleMap, Map<String, Permission> permissionMap) {
Role systemRole = roleMap.get(BuiltinAuthRegistry.toRoleKey(BootstrapData.SYS_ROLE_MODULE_CODE, BootstrapData.SYS_ROLE_CODE));
Role adminRole = roleMap.get(BuiltinAuthRegistry.toRoleKey(BootstrapData.ADMIN_ROLE_MODULE_CODE, BootstrapData.ADMIN_ROLE_CODE));
Role gaoGlobalManagerRole = roleMap.get(BuiltinAuthRegistry.toRoleKey(ModuleCode.GAO, GaoRoleCode.GLOBAL_MANAGER.name()));
Role gaoStoreManagerRole = roleMap.get(BuiltinAuthRegistry.toRoleKey(ModuleCode.GAO, GaoRoleCode.STORE_MANAGER.name()));
for (BuiltinPermissionCode item : BuiltinAuthRegistry.PERMISSION_CODE_LIST) {
Permission permission = permissionMap.get(BuiltinAuthRegistry.toPermissionKey(item.getModuleCode(), item.getValue()));
@@ -204,6 +205,9 @@ public class InitBuiltinUser implements ApplicationRunner {
if (item.isGrantToAdmin() && adminRole != null) {
createRolePermissionIfAbsent(adminRole.getId(), permission.getId());
}
if (item instanceof GaoPermissionCode gaoPermission && gaoPermission.isGrantToGlobalManager() && gaoGlobalManagerRole != null) {
createRolePermissionIfAbsent(gaoGlobalManagerRole.getId(), permission.getId());
}
if (item instanceof GaoPermissionCode gaoPermission && gaoPermission.isGrantToStoreManager() && gaoStoreManagerRole != null) {
createRolePermissionIfAbsent(gaoStoreManagerRole.getId(), permission.getId());
}