Skip to content
Permalink
Browse files
Merge pull request #35 from isururanawaka/sharing_service_impl
Bug fix in sharedWith
  • Loading branch information
isururanawaka committed Aug 11, 2021
2 parents 65d01f2 + 33b9c03 commit c6b57fb5ebe4f9dccc9fe3e0612dfb631072d713
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
@@ -419,13 +419,11 @@ public void searchResource(ResourceSearchRequest
String val = qry.getValue();
String query = "MATCH (u:User) where u.username = $username AND u.tenantId = $tenantId " +
" OPTIONAL MATCH (g:Group)<-[:MEMBER_OF]-(u) " +
" OPTIONAL MATCH (u)<-[relRM:SHARED_WITH]-(m)<-[:CHILD_OF*]-(rm:" + value + ") , " +
"(r:" + value + ")-[rel:SHARED_WITH]->(u) where NOT r.owner = '" + val + "'" +
" AND NOT rm.owner='" + val + "' " +
" OPTIONAL MATCH (g)<-[relRMG:SHARED_WITH]-(mg)<-[:CHILD_OF*]-(rmg:" + value + ")," +
" (rg:" + value + ")-[relRG:SHARED_WITH]->(g) where NOT rg.owner = '" + val + "'" +
" AND NOT rmg.owner='" + val + "' " +
" return distinct r,rel, rm,relRM, rmg,relRMG, rg,relRG ";
// " OPTIONAL MATCH (u)<-[relRM:SHARED_WITH]-(m)<-[:CHILD_OF*]-(rm:" + value + ") where NOT rm.owner='" + val + "'" +
" OPTIONAL MATCH (r:" + value + ")-[rel:SHARED_WITH]->(u) where NOT r.owner = '" + val + "'" +
// " OPTIONAL MATCH (g)<-[relRMG:SHARED_WITH]-(mg)<-[:CHILD_OF*]-(rmg:" + value + ") where NOT rmg.owner='" + val + "' " +
" OPTIONAL MATCH (rg:" + value + ")-[relRG:SHARED_WITH]->(g) where NOT rg.owner = '" + val + "'" +
" return distinct r,rel, rg,relRG ";
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("username", val);
objectMap.put("tenantId", callUser.getTenantId());
@@ -435,7 +433,7 @@ public void searchResource(ResourceSearchRequest
keyList.add("rm:relRM");
keyList.add("rmg:relRMG");
keyList.add("rg:relRG");
List<GenericResource> genericResourceList = GenericResourceDeserializer.deserializeList(records,keyList);
List<GenericResource> genericResourceList = GenericResourceDeserializer.deserializeList(records, keyList);
ResourceSearchResponse.Builder builder = ResourceSearchResponse.newBuilder();
builder.addAllResources(genericResourceList);
responseObserver.onNext(builder.build());
@@ -551,7 +549,7 @@ public void searchResource(ResourceSearchRequest

List<Record> records = this.neo4JConnector.searchNodes(userProps, query);

List<GenericResource> genericResourceList = GenericResourceDeserializer.deserializeList(records,keyList);
List<GenericResource> genericResourceList = GenericResourceDeserializer.deserializeList(records, keyList);
ResourceSearchResponse.Builder builder = ResourceSearchResponse.newBuilder();
builder.addAllResources(genericResourceList);
responseObserver.onNext(builder.build());
@@ -54,6 +54,7 @@
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation.version}</version>
</dependency>

</dependencies>
<build>
<extensions>

0 comments on commit c6b57fb

Please sign in to comment.