Back to Access class

Method getGroupPath

protected static mixed
getGroupPath
(mixed $groupId)
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).
Parameters
  • mixed $groupId An integer or array of integers representing the identities to check.
Returns
  • mixed True if allowed, false for an explicit deny, null for an implicit deny.
Since
  • 1.7.0
Class: Access
Project: Joomla

Method getGroupPath - Source code

/**
 * 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;
}