/**
 * Gets the parent groups that a leaf group belongs to in its branch back to the root of the tree
 * (including the leaf group id).
 *
 * @param   mixed  $groupId  An integer or array of integers representing the identities to check.
 *
 * @return  mixed  True if allowed, false for an explicit deny, null for an implicit deny.
 *
 * @since   1.7.0
 */
protected static function getGroupPath($groupId)
{
    // Load all the groups to improve performance on intensive groups checks
    $groups = UserGroupsHelper::getInstance()->getAll();
    if (!isset($groups[$groupId])) {
        return array();
    }
    return $groups[$groupId]->path;
}