Returns a GroupUsersCursor with list of User instances for this Group

        .. versionadded:: 2.16.2
498259
def users(self):
        
        if self.__users is None:
            self.__users = GroupUsersCursor(swimlane=self._swimlane, user_ids=self.__user_ids)
        return self.__users
673654
def get_group_members(group_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        marker = None
        truncated = True
        users = []
        while truncated:
            info = conn.get_group(group_name, marker=marker, max_items=1000)
            if not info:
                return False
            truncated = bool(info['get_group_response']['get_group_result']['is_truncated'])
            if truncated and 'marker' in info['get_group_response']['get_group_result']:
                marker = info['get_group_response']['get_group_result']['marker']
            else:
                marker = None
                truncated = False
            users += info['get_group_response']['get_group_result']['users']
        return users
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to get members for IAM group %s.', group_name)
        return False
1275618
def by_group(self):  # pragma: no cover
        
        group_membership = {}
        for record in self.__get_groups_with_membership():
            group_membership[record.cn.value] = [
                i for i in record.memberUid.values
            ]
        return group_membership
348338
def get_groups(user=None):
    
    portal_groups = get_tool("portal_groups")
    user = get_user(user)
    if user is None:
        return []
    return portal_groups.getGroupsForPrincipal(user)
367514
def getUsers(context, roles, allow_empty=True):
    
    mtool = getToolByName(context, 'portal_membership')
    pairs = allow_empty and [['', '']] or []
    users = mtool.searchForMembers(roles=roles)
    for user in users:
        uid = user.getId()
        fullname = user.getProperty('fullname')
        if not fullname:
            fullname = uid
        pairs.append((uid, fullname))
    pairs.sort(lambda x, y: cmp(x[1], y[1]))
    return DisplayList(pairs)
514112
def cli(ctx, group, user):
    
    return ctx.gi.users.add_to_group(group, user)
66178
def get_all_users(path_prefix='/', region=None, key=None, keyid=None,
                 profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if not conn:
        return None
    _users = conn.get_all_users(path_prefix=path_prefix)
    users = _users.list_users_response.list_users_result.users
    marker = getattr(
        _users.list_users_response.list_users_result, 'marker', None
    )
    while marker:
        _users = conn.get_all_users(path_prefix=path_prefix, marker=marker)
        users = users + _users.list_users_response.list_users_result.users
        marker = getattr(
            _users.list_users_response.list_users_result, 'marker', None
        )
    return users
322235
def get_groups(self, username):
        
        try:
            return self.users[username]['groups']
        except Exception as e:
            raise UserDoesntExist(username, self.backend_name)
271195
def visible_to_user(self, user):
        

        return Host.objects.filter(Q(groups_visible__in=user.groups.all()) | Q(groups_visible__isnull=True)).distinct()
1125644
def _get_users_of_group(config, group):
    
    if not group:
        return set()
    fas = fmn.rules.utils.get_fas(config)
    return fmn.rules.utils.get_user_of_group(config, fas, group)
68806
def user_list(self, userid, cur_p=''):
        '''
        
        '''
        current_page_number = int(cur_p) if cur_p else 1
        current_page_number = 1 if current_page_number < 1 else current_page_number

        kwd = {
            'current_page': current_page_number
        }

        recs = MEntity2User.get_all_pager_by_username(userid, current_page_num=current_page_number).objects()

        self.render('misc/entity/entity_user_download.html',
                    imgs=recs,
                    cfg=config.CMS_CFG,
                    kwd=kwd,
                    userinfo=self.userinfo)
935050
def context_list_users(zap_helper, context_name):
    """"""
    with zap_error_handler():
        info = zap_helper.get_context_info(context_name)

    users = zap_helper.zap.users.users_list(info['id'])
    if len(users):
        user_list = ', '.join([user['name'] for user in users])
        console.info('Available users for the context {0}: {1}'.format(context_name, user_list))
    else:
        console.info('No users configured for the context {}'.format(context_name))
789272
def list_users(self):
        
        crypt = self._decrypt_file()

        self.logger.info(crypt.stderr)
        raw_userlist = crypt.stderr.split('\n')
        userlist = list()
        for index, line in enumerate(raw_userlist):
            if 'gpg: encrypted' in line:
                m = re.search('ID (\w+)', line)
                keyid = m.group(1).strip()
                userline = raw_userlist[index+1].strip()
                userlist.append((keyid, userline))
        return userlist
134301
def group_perms_for_user(cls, instance, user, db_session=None):
        
        db_session = get_db_session(db_session, instance)
        perms = resource_permissions_for_users(
            cls.models_proxy,
            ANY_PERMISSION,
            resource_ids=[instance.resource_id],
            user_ids=[user.id],
            db_session=db_session,
        )
        perms = [p for p in perms if p.type == "group"]
        # include all perms if user is the owner of this resource
        groups_dict = dict([(g.id, g) for g in user.groups])
        if instance.owner_group_id in groups_dict:
            perms.append(
                PermissionTuple(
                    user,
                    ALL_PERMISSIONS,
                    "group",
                    groups_dict.get(instance.owner_group_id),
                    instance,
                    True,
                    True,
                )
            )
        return perms
569065
def get_instances(self):
        
        if self._update_members: self.update()
        return iter(sorted(self.members.iteritems()))
418363
def get_group_dict(user=None, include_default=True):
    '''
    
    '''
    if HAS_GRP is False or HAS_PWD is False:
        return {}
    group_dict = {}
    group_names = get_group_list(user, include_default=include_default)
    for group in group_names:
        group_dict.update({group: grp.getgrnam(group).gr_gid})
    return group_dict
1328014
def get_users(self, **kwargs):
        
        return GetUsers(settings=self.settings, **kwargs).call(**kwargs)