title: Obtaining Role by User id with Restull API
body: <p>I'm trying to obtain the role of some user (by its id), currently i do this way:</p>
  
  <p><em>$this is a home-made API access outside of SugarCRM, the session is implicitly sent</em></p>
  
  <pre><code>$roles = $this-&gt;get_entry_list('ACLRoles', null, null, null, array('name'));
         if ($roles) {
              foreach ($roles-&gt;entry_list as $role) {
                  $result = $this-&gt;get_relationships('ACLRoles', $role-&gt;id, 'users', 'user_id=' . $userId);
                  if (count($result-&gt;entry_list) &gt; 0) {
                      return array(
                          'id' =&gt; $role-&gt;id,
                          'name' =&gt; $role-&gt;name_value_list-&gt;name-&gt;value
                      );
                  }
              }
         }
  </code></pre>
  
  <p>I, however, consider this an inefficient solution, due that i need to iterate over all the roles to check if the user is there... I have been looking at the API and been trying other methods, but i cannot get to relation Users -> ACLRoles, only ACLRoles -> Users...</p>
  
  <p>Is there a better way to get the Role of an User?</p>