Skip to content
Permalink
Browse files
Bug fix in resource fetching
  • Loading branch information
isururanawaka committed Sep 10, 2021
1 parent c2c746d commit 0aefe629377086f5536315ffbc0836aa75bfa311
Showing 1 changed file with 5 additions and 9 deletions.
@@ -456,15 +456,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 (x:" + value + ")-[relR:SHARED_WITH]->(u) where NOT x.owner = '" + val + "'" +
// " 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 + "'" +
" AND NOT (r)-[:CHILD_OF*]->(x) " +
// " 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 + "'" +
" OPTIONAL MATCH (rgr:" + value + ")-[relRGR:SHARED_WITH]->(g) where NOT rgr.owner = '" + val + "'" +
" AND NOT (rgr)-[:CHILD_OF*]->(rg) " +
" return distinct r,rel, rgr,relRGR ";
" OPTIONAL MATCH (u)<-[:SHARED_WITH]-(p:COLLECTION)<-[:CHILD_OF*] -(x:" + value + ")-[relR:SHARED_WITH]->(u)" +
" where NOT x.owner = '" + val + "' " +
" OPTIONAL MATCH (g)<-[:SHARED_WITH]-(pr:COLLECTION)<-[:CHILD_OF*] -(px:" + value + ")-[relR:SHARED_WITH]->(g)" +
" where NOT px.owner = '" + val + "'" +
" return distinct p, px";
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("username", val);
objectMap.put("tenantId", callUser.getTenantId());

0 comments on commit 0aefe62

Please sign in to comment.