title: Discover all vertices of a type from origin
body: <p>I'm modeling a permission system with graph-database.
  This is an example scenario:</p>
  
  <p><a href="https://i.stack.imgur.com/21xA7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/21xA7.png" alt="graph image for example"></a></p>
  
  <p>An user <code>u1</code> has a direct permission and also is in a group <code>g1</code> that has permissions and extends another group.</p>
  
  <p>An user also <code>manage</code>s a system <code>s1</code> and can give the permissions related to <code>s1</code> to another users.</p>
  
  <p>Basically what I need to do is get all permissions for my <code>u1</code>.
  I suspected it is a simple query but I'm having a hard time with gremlin.</p>
  
  <p>I have tried combinations of <code>repeat()</code>s, <code>out()</code>s, <code>emit()</code>s, <code>path()</code>s, etc. but couldn't find what I need. All I have tried returns either more nodes than needed (like the group nodes that are in the path of the permission, or the permissions related to the system) or fewer nodes (like not reaching <code>G2</code>)</p>
  
  <p>So to sumarize what I need is:</p>
  
  <pre><code>gremlin&gt; g.V('u1').__misteriousQueryThatShouldntBeThatHard()
  ==&gt; v[p1]
  ==&gt; v[p2]
  ==&gt; v[p3]
  ==&gt; v[p4]
  </code></pre>
  
  <p>Appreciate any help.</p>