code: public List<String> getImplicitRolesForUser(String name, String... domain) {
          List<String> roles = this.rm.getRoles(name, domain);
          List<String> res = new ArrayList<>(roles);
          for (String n : roles) {
              res.addAll(this.getImplicitRolesForUser(n, domain));
          }
          return res;
      }
docs: getImplicitRolesForUser gets implicit roles that a user has.
  Compared to getRolesForUser(), this function retrieves indirect roles besides direct roles.
  For example:
  g, alice, role:admin
  g, role:admin, role:user
  <p>
  getRolesForUser("alice") can only get: ["role:admin"].
  But getImplicitRolesForUser("alice") will get: ["role:admin", "role:user"].
  
  @param name   the user
  @param domain the domain
  @return implicit roles that a user has.