We have been discussing this usecase since few days on StackOverFlow.
as Stephen pointed out few suggestions which should work, but looks like to make that work, I need a deeper understanding about the workflow of how a given query gets executed end to end.
summarised suggested approach:
1/ develop a custom
TraversalStrategy i.e. CustomUserPermissionStrategy similar to SubgraphStrategy or PartitionStrategy which would take your user permissions on construction and then automatically inject the necessary has() steps after out() / in() sorts of steps.
and use the same strategy to instantiate g in empty-sample.groovy something like this:
global <<[g: graph.buildTransaction().readOnly().start().traversal().withTraversal(CustomUserPermissionStrategy.build())]
- Not sure if this will work?
Now we need to get access to the user principle from the HttpRequesta and that means the same details needs to make available in my CustomUserPermissionStrategy for us to them invoke the entitlement engine REST API for the user principle and apply the user's permissions on traversal strategy or(has('permission', 'team1'), has('permission', 'team2')) on all visited nodes
2/ For this to achieve, looks like we need to write our own HttpGremlinEndpointHandler and HttpChanelizer.
Qns:
a) what is the best way to learn about the internal workflow of query execution pipeline?
b) How do I plug these in in the janus gremlin server config?
c) lastly.. are we going the right path to achieve this need?
any help would be highly appreciated. Have been struggling with this for quite sometime.
Thanks
Sandip
Appreciate If I get some help/sample code snippet