Skip to content

Commit

Permalink
-update PR as per review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nayan committed Jun 24, 2021
1 parent 0383c7b commit eeba8f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ public Flux<Application> updateWithNewPoliciesToApplicationsByOrgId(String orgId
.flatMapMany(updatedApplications -> applicationRepository.saveAll(updatedApplications));
}

public Flux<UserRole> updateCommentThreadPoliciesByOrgId(String orgId, List<UserRole> userRoles) {
public void updateCommentThreadPoliciesByOrgId(String orgId, List<UserRole> userRoles) {
for(UserRole userRole : userRoles) {
UserRole publish = userChangedHandler.publish(orgId, userRole);
userChangedHandler.publish(orgId, userRole);
}
return Flux.fromIterable(userRoles);
}

public Flux<NewPage> updateWithApplicationPermissionsToAllItsPages(String applicationId, Map<String, Policy> newPagePoliciesMap, boolean addPolicyToObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ public Mono<Organization> bulkAddUsersToOrganization(Organization organization,
.flatMap(application -> policyUtils.updateWithApplicationPermissionsToAllItsPages(application.getId(), pagePolicyMap, true));
Flux<NewAction> updatedActionsFlux = updatedApplicationsFlux
.flatMap(application -> policyUtils.updateWithPagePermissionsToAllItsActions(application.getId(), actionPolicyMap, true));
Flux<UserRole> commentThreadPoliciesFlux = policyUtils.updateCommentThreadPoliciesByOrgId(organization.getId(), userRoles);

policyUtils.updateCommentThreadPoliciesByOrgId(organization.getId(), userRoles);

return Mono.when(
updatedDatasourcesFlux.collectList(),
updatedPagesFlux.collectList(),
updatedActionsFlux.collectList(),
commentThreadPoliciesFlux)
updatedActionsFlux.collectList())
//By now all the datasources/applications/pages/actions have been updated. Just save the organization now
.then(organizationRepository.save(updatedOrganization));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,7 @@ public Mono<List<User>> inviteUsers(InviteUsersDTO inviteUsersDTO, String origin
.flatMap(tuple -> {
List<User> invitedUsers = tuple.getT1();
Organization organization = tuple.getT2();
return userOrganizationService.bulkAddUsersToOrganization(
organization, invitedUsers, inviteUsersDTO.getRoleName()
);
return userOrganizationService.bulkAddUsersToOrganization(organization, invitedUsers, inviteUsersDTO.getRoleName());
});

// Add organization id to each invited user
Expand Down

0 comments on commit eeba8f4

Please sign in to comment.