I have a neo4j graph looking like this:
(AdminUser) - [is_admin] -> (Tenat) - [can_edit,can_read] -> (Resource)
(RegularUser) - [can_edit] -> (Resource)
(RegularUser2) - [can_read] -> (Resource)
This a simplified version, so I want to get all Resource that a given user is connected on any path, but such that last relationship before Resource node is 'can_edit'
I would try something like
match(u:User{id:'regular'}) // I'd like to insert user id here
-[*]->(r:Resource) // here not sure how to limit last relation as can_edit
In the example above, I'd like to get Resource when if I insert either AdminUser or RegularUser id, but not RegularUser2