Wednesday, 11 September 2013

Traversing an ACL Neo4J structure based on a specific leaf node

Traversing an ACL Neo4J structure based on a specific leaf node

We have trying to understand the Neo4J ACL Example. We are trying to
traverse the graph from the Top-Down approach. We managed to find the root
node via:
start n = node:node_auto_index(Name = "myFile.pdf") match
(n)<-[*]-(x)<-[:CONTENT_ROOT]-(p) return n,x;
and then the permission list on the root folder via:
start n = node:node_auto_index(Name = "user1") match
(n)-[*]->(x)-[:IS_MEMBER_OF_GROUP]->(p) return p;
How would we determine which one is the most generic?
Now the trouble we are facing is returning the permissions for each node
back down to "myFile.pdf" node. We seem to either get the "temp" node
included in the query or its not returning all the nodes.
What we have tried:
start n = node:node_auto_index(Name = "Root Folder") match
(n)<-[r:SECURITY]-(x) return n, r.Comment, x;
Is there a better way of doing this (permissions)?

No comments:

Post a Comment