add store
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user