public function roles($aro)
{
$aros = [];
$aro = $this->resolve($aro);
$stack = [[$aro, 0]];
while (!empty($stack)) {
list($element, $depth) = array_pop($stack);
$aros[$depth][] = $element;
foreach ($this->_tree as $node => $children) {
if (in_array($element, $children)) {
array_push($stack, [$node, $depth + 1]);
}
}
}
return array_reverse($aros);
}