Skip to content
Permalink
Browse files
Bug fix in resource fetching
  • Loading branch information
isururanawaka committed Sep 9, 2021
1 parent 8d9a82c commit 260e084a2da42efbc1477c6909dabb43595b7966
Showing 1 changed file with 4 additions and 2 deletions.
@@ -191,7 +191,8 @@ public void createResource(ResourceCreateRequest request, StreamObserver<Resourc

String query = " MATCH (u:User), (r:" + type + ") where u.username = $username AND u.tenantId = $tenantId AND " +
" r.entityId = $entityId AND r.tenantId = $tenantId" +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF*]->(g:Group)<-[:MEMBER_OF]-(u)" +
" OPTIONAL MATCH (g:Group)<-[:MEMBER_OF]-(u) " +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF]->(g)" +
" return case when exists((u)<-[:SHARED_WITH]-(r)) OR exists((g)<-[:SHARED_WITH]-(r)) OR " +
"exists((cg)<-[:SHARED_WITH]-(r)) then r else NULL end as value";

@@ -353,7 +354,8 @@ public void updateResource(ResourceUpdateRequest

String query = " MATCH (u:User), (r:" + type + ") where u.username = $username AND u.tenantId = $tenantId AND " +
" r.entityId = $entityId AND r.tenantId = $tenantId" +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF*]->(g:Group)<-[:MEMBER_OF]-(u)" +
" OPTIONAL MATCH (g:Group)<-[:MEMBER_OF]-(u) " +
" OPTIONAL MATCH (cg:Group)-[:CHILD_OF]->(g)" +
" return case when exists((u)<-[:SHARED_WITH]-(r)) OR exists((g)<-[:SHARED_WITH]-(r)) OR " +
"exists((cg)<-[:SHARED_WITH]-(r)) then r else NULL end as value";

0 comments on commit 260e084

Please sign in to comment.