Commit 4690be6d by shiwenbo

取消自定义角色重名的判断

parent a5094080
......@@ -62,10 +62,10 @@ public class RoleManagerServiceImpl implements RoleManagerService {
Assert.hasText(roleInfo.getTitle(), "角色标题不能为空");
Assert.notNull(roleInfo.getGroup(), "角色分组不能为空");
List<Role> roles = roleService.getAllRole();
if(roles.stream().anyMatch(role -> roleInfo.getTitle().equals(role.getTitle()))){
throw new AuthValidateException("角色的名称已经存在");
}
// List<Role> roles = roleService.getAllRole();
// if(roles.stream().anyMatch(role -> roleInfo.getTitle().equals(role.getTitle()))){
// throw new AuthValidateException("角色的名称已经存在");
// }
//保存角色信息
......@@ -119,10 +119,10 @@ public class RoleManagerServiceImpl implements RoleManagerService {
Assert.notNull(roleInfo.getId(), "角色id不能为空");
Assert.hasText(roleInfo.getTitle(), "角色标题不能为空");
List<Role> roles = roleService.getAllRole();
if(roles.stream().anyMatch(role -> !roleInfo.getId().equals(role.getId()) && roleInfo.getTitle().equals(role.getTitle()))){
throw new IllegalArgumentException("角色的名称已经存在");
}
// List<Role> roles = roleService.getAllRole();
// if(roles.stream().anyMatch(role -> !roleInfo.getId().equals(role.getId()) && roleInfo.getTitle().equals(role.getTitle()))){
// throw new IllegalArgumentException("角色的名称已经存在");
// }
Optional<Role> roleOptional = roleService.get(roleInfo.getId());
if(roleOptional.isPresent()){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment