Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
4690be6d
Commit
4690be6d
authored
May 21, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消自定义角色重名的判断
parent
a5094080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
RoleManagerServiceImpl.java
.../inz/authmgr/internal/service/RoleManagerServiceImpl.java
+8
-8
No files found.
backend/inz.authmgr/src/main/java/com/beecode/inz/authmgr/internal/service/RoleManagerServiceImpl.java
View file @
4690be6d
...
...
@@ -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
()){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment