Commit 407f2463 authored by Bill Wang's avatar Bill Wang Committed by Spencer Sutton
Browse files

inspect check gate for user node exist

parent 2d5290b6
......@@ -40,7 +40,12 @@ public class AddMemberService {
log.info(String.format("requested by %s", addMemberServiceDto.getRequesterId()));
String memberDesId = addMemberDto.getEmail();
EntityNode memberNode = retrieveGroupRepo.getEntityNode(memberDesId, addMemberServiceDto.getPartitionId()).orElseGet(
() -> createNewMemberNode(addMemberDto.getEmail(), memberDesId, addMemberServiceDto.getPartitionId()));
() -> {
System.out.println("No user Node found, adding it");
return createNewMemberNode(addMemberDto.getEmail(), memberDesId, addMemberServiceDto.getPartitionId())
}
);
EntityNode existingGroupEntityNode = retrieveGroupRepo.groupExistenceValidation(addMemberServiceDto.getGroupEmail(), addMemberServiceDto.getPartitionId());
EntityNode requesterNode = EntityNode.createMemberNodeForRequester(addMemberServiceDto.getRequesterId(), addMemberServiceDto.getPartitionId());
if (!permissionService.hasOwnerPermissionOf(requesterNode, existingGroupEntityNode)) {
......
......@@ -81,7 +81,9 @@ public class AwsRetrieveGroupRepo implements RetrieveGroupRepo {
commands.select(config.getPartitionEntityNode());
String groupNodeJson = commands.get(entityEmail);
EntityNode groupNode = null;
System.out.println("The value of GropNodeJson is " +groupNodeJson);
if (!StringUtils.isEmpty(groupNodeJson)) {
groupNode = JsonConverter.fromJson(groupNodeJson, EntityNode.class);
}
return Optional.ofNullable(groupNode);
......
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