What extra users statisfy this 'query' (above $this->allowedUserGroups()):
<code>$this->isAllowed( 'user.group.*.%id%', $privilege )</code>

@param string $privilege
@return array :id => :name pairs
489190
public function allowedUsers( $privilege = self::PRIVILEGE_DEFAULT )
    {
        $auth = $this->getAuthenticationService();

        if ( $auth->hasIdentity() )
        {
            $identity = $auth->getIdentity();

            return array(
                $identity->id => $identity->displayName,
            );
        }
        else
        {
            return array();
        }
    }
758434
public function setPrivilege($privilege = null)
        {
            $this->_privilege = is_string($privilege) ? $privilege : null;
            return $this;
        }
783164
function group_users($group_name=NUL){
        $result = array();
        if ($group_name==NULL){ return (false); }
        if (!$this->_bind){ return (false); }
        $filter="(&(|(objectClass=posixGroup)(objectClass=groupofNames))(".$this->_group_cn_identifier."=".$this->ldap_search_encode($group_name)."))";

        $fields=array("member","memberuid");
        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
        $entries = $this->ldap_get_entries_raw($sr);

        // DEBUG
        if (0 == count($entries)) {
            $this->_warning_message = "group_users: No entry for the specified filter $filter";
            echo "DEBUG: ".$this->_warning_message;
        }

        if (isset($entries[0]["member"][0]))
        {
            $result = $this->nice_names($entries[0]["member"]);
            /*
            for ($i=0; $i++; $i < $entries[0]["member"][count])
            {
                $result[] == ($entries[0]["member"][$i]);
            }
            */
        }
        elseif (isset($entries[0]["memberuid"][0]))
        {
            $result = $this->nice_names($entries[0]["memberuid"]);
        }
        else
        {
            $result = array();
        }
        return ($result);
    }
76737
protected function getUsers()
    {
        $qb = $this->registry->getManager()->createQueryBuilder();

        $qb
            ->select('u')
            ->from($this->userClass, 'u')
            ->where($qb->expr()->like('u.roles', ':roles'))
            ->setParameter('roles', '%"ROLE_SUPER_ADMIN"%');

        return $qb->getQuery()->iterate();
    }
535812
public function isAllowed($resource = Nette\Security\IAuthorizator::ALL, $privilege = Nette\Security\IAuthorizator::ALL)
	{
		$defaultNamespace = null;

		if (strpos($resource, ":") !== false) {
			$exploded = explode(":", $resource);
			if (count($exploded) == 2) {
				list($namespace, $resource) = $exploded;
				$defaultNamespace = $this->namespacesRepository->getDefaultNamespace();
				$this->namespacesRepository->setCurrentNamespace($namespace);
			}
		}

		foreach ($this->getRoles() as $role) {
			if ($this->getAuthorizator()->isAllowed($role, $resource, $privilege)) {
				$this->namespacesRepository->setCurrentNamespace($defaultNamespace);
				return true;
			}
		}

		$this->namespacesRepository->setCurrentNamespace($defaultNamespace);
		return false;
	}
107229
protected function getUsedPrivileges()
    {
        if (! $this->usedPrivileges) {
            $privileges = $this->menu->getUsedPrivileges();

            asort($privileges);
            //don't allow to edit the pr.nologin and pr.islogin privilege
            unset($privileges['pr.nologin']);
            unset($privileges['pr.islogin']);

            $this->usedPrivileges = $privileges;
        }

        return $this->usedPrivileges;
    }
1087519
public function getUser(string $query, array $extra_args = null)
    {
        if (is_numeric($query)) {
            $response = $this->getUserByID($query, $extra_args);
            if (!isset($response['errors'])) {
                return $response;
            }
        }
        return $this->getUserByUsername($query, $extra_args);
    }
73601
public function getAccessEntityUsers(PermissionAccess $pa)
    {
        $userList = new UserList();
        $userList->ignorePermissions();
        foreach ($this->groups as $g) {
            $userList->filterByGroupID($g->getGroupID());
        }

        return $userList->getResults();
    }
815816
public function getUsers($descendants = false) {
    if ($descendants) {
      $groups = $this->getDescendants();
      $or = ['|',
          'ref' => [
            ['group', $groups],
            ['groups', $groups]
          ]
        ];
    } else {
      $or = null;
    }
    $groups[] = $this;
    $return = Nymph::getEntities(
        ['class' => '\Tilmeld\Entities\User'],
        ['&',
          'equal' => ['enabled', true]
        ],
        $or
    );
    return $return;
  }
534042
public static function getAccessEntitiesForUser($user)
    {
        $entities = [];
        // If the user isnt registered, there is no need to do this anymore.
        if ($user->isRegistered()) {
            $ingids = [];
            $app = Facade::getFacadeApplication();
            /** @var $database \Concrete\Core\Database\Connection\Connection */
            $database = $app->make('database')->connection();

            // First look for any combos that this group would specifically be in.
            // We check if the combos contain any of the groups this user is in.
            // That way if there aren't any we can just skip it.
            foreach ($user->getUserGroups() as $key => $val) {
                $ingids[] = $key;
            }
            $instr = implode(',', $ingids);

            $peIDs = $database->fetchAll(
                'select distinct pae.peID from PermissionAccessEntities pae
                inner join PermissionAccessEntityTypes paet on pae.petID = paet.petID
                inner join PermissionAccessEntityGroups paeg on pae.peID = paeg.peID
                where petHandle = \'group_combination\' 
                and paeg.gID in (' . $instr . ')'
            );
            // Now for each one we check to see if it applies here.
            foreach ($peIDs as $peID) {
                $r = $database->fetchAssoc(
                    'select count(gID) as peGroups, 
                    (select count(UserGroups.gID) from UserGroups where uID = ? 
                      and gID in 
                      (select gID from PermissionAccessEntityGroups where peID = ?))
                     as uGroups from PermissionAccessEntityGroups where peID = ?',
                    [$user->getUserID(), $peID['peID'], $peID['peID']]
                );
                if ($r['peGroups'] == $r['uGroups'] && $r['peGroups'] > 1) {
                    $entity = Entity::getByID($peID['peID']);
                    if (is_object($entity)) {
                        $entities[] = $entity;
                    }
                }
            }
        }

        return $entities;
    }
97791
function isAllowed($role, $resource, $privilege)
	{
		if ($this->mode == self::MODE_OPTIMISTIC) {
			$roles = $this->aclModel->getTableSelection()
				->select('role')
				->where('namespace', $this->getNamespaceRepository()->getCurrentNamespace())
				->where('resource', $resource)
				->where('privilege', $privilege)
				->fetchPairs('role', 'role');
			return count($roles) == 0 || array_key_exists($role, $roles);
		} elseif($this->mode == self::MODE_PESSIMISTIC) {
			return (bool) $this->aclModel->getTableSelection()
				->select('id')
				->where('namespace', $this->getNamespaceRepository()->getCurrentNamespace())
				->where('role', $role)
				->where('resource', $resource)
				->where('privilege', $privilege)
				->count();
		}
	}
651804
private function findNonExistingUserGroupId()
    {
        $userGroupManager = $this->getUserGroupManager();
        for ( $i = 0; $i < 20; $i++ )
        {
            $id = uniqid('UserGroup#', true);
            if ( !$userGroupManager()->checkUserGroupExistence( $id ) )
            {
                return $id;
            }
        }

        throw new \Exception( 'Possible endless loop when attempting to find a new id for UserGroup.' );
    }
491547
public function find_users($search) {
        global $DB;
        // By default wherecondition retrieves all users except the deleted, not confirmed and guest.
        list($wherecondition, $params) = $this->search_sql($search, 'u');
        $params['enrolid'] = $this->enrolid;

        $fields      = 'SELECT ' . $this->required_fields_sql('u');
        $countfields = 'SELECT COUNT(1)';

        $sql = " FROM {user} u
                 JOIN {user_enrolments} ue ON (ue.userid = u.id AND ue.enrolid = :enrolid)
                WHERE $wherecondition";

        list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
        $order = ' ORDER BY ' . $sort;

        if (!$this->is_validating()) {
            $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
            if ($potentialmemberscount > $this->maxusersperpage) {
                return $this->too_many_results($search, $potentialmemberscount);
            }
        }

        $availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));

        if (empty($availableusers)) {
            return array();
        }


        if ($search) {
            $groupname = get_string('enrolledusersmatching', 'enrol', $search);
        } else {
            $groupname = get_string('enrolledusers', 'enrol');
        }

        return array($groupname => $availableusers);
    }
178708
public function getAuthority()
    {
        return ( $this->_user ? $this->_user . '@' : '') . $this->_host . (isset($this->_port) ? ':' . $this->_port : '');
    }
135614
function fetchMemberOf( $id )
    {
        $user = eZUser::fetch( $id );
        if ( $user instanceof eZUser )
            $roleList = $user->roles();
        else // user group or other non user classes:
            $roleList = eZRole::fetchByUser( array( $id ), true );

        return array( 'result' => $roleList );
    }
173089
public static function getNestedPermissionIds(string $permissionName)
    {
        if (self::isAdmin()) {
            return true;
        }

        $user           = \Craft::$app->getUser();
        $permissionName = strtolower($permissionName);
        $idList         = [];

        if (self::permissionsEnabled()) {
            if (!$user->getId()) {
                return [];
            }

            $permissionList = \Craft::$app->userPermissions->getPermissionsByUserId($user->getId());
            foreach ($permissionList as $permission) {
                if (strpos($permission, $permissionName) === 0) {
                    if (strpos($permission, ':') === false) {
                        continue;
                    }

                    list($name, $id) = explode(':', $permission);

                    $idList[] = $id;
                }
            }

            return $idList;
        }

        return self::isAdmin();
    }
1175913
protected function getUserInformation($user = null)
    {
        // Defaults
        if (is_null($user)) {
            return [
                'name' => 'Guest',
                'user' => ['guest' => true],
            ];
        }

        // The default auth identifer is the ID number, which isn't all that
        // useful. Try username and email.
        $identifier = $user->getAuthIdentifier();
        if (is_numeric($identifier)) {
            try {
                if ($user->username) {
                    $identifier = $user->username;
                } elseif ($user->email) {
                    $identifier = $user->email;
                }
            } catch (\Exception $e) {
            }
        }

        return [
            'name' => $identifier,
            'user' => $user instanceof Arrayable ? $user->toArray() : $user,
        ];
    }