public function roles($name) { // Add this role to the set $roles = array($name); if (isset($this->_roles[$name])) { foreach ($this->_roles[$name] as $role) { // Inherit parents $roles = array_merge($this->roles($role), $roles); } } return $roles; }