Skip to content

Commit 8db8910

Browse files
committed
Update persistAll method to return list of roles
The persistAll method in RoleService.java has been revised to return a list of Role objects after saving them. This change is also reflected in FENCEAuthenticationService.java where the returned list of new roles is now properly assigned to newRoles.
1 parent ed3fda6 commit 8db8910

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/RoleService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public Set<Role> getRolesByIds(Set<UUID> roleUuids) {
120120
return this.roleRepository.findByUuidIn(roleUuids);
121121
}
122122

123-
public void persistAll(List<Role> newRoles) {
124-
this.roleRepository.saveAll(newRoles);
123+
public List<Role> persistAll(List<Role> newRoles) {
124+
return this.roleRepository.saveAll(newRoles);
125125
}
126126

127127
public void persistAll(Set<Role> newRoles) {

pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/authentication/FENCEAuthenticationService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public HashMap<String, String> getFENCEProfile(String callback_url, Map<String,
271271
.collect(Collectors.toList());
272272

273273
if (!newRoles.isEmpty()) {
274-
roleService.persistAll(newRoles);
274+
newRoles = roleService.persistAll(newRoles);
275275
current_user.getRoles().addAll(newRoles);
276276
}
277277

0 commit comments

Comments
 (0)