// GroupMembers returns all member's UIDs
972705
func (c *EtcdGroupService) GroupMembers(ctx context.Context, groupName string) ([]string, error) {
	prefix := memberKey(groupName, "")
	ctxT, cancel := context.WithTimeout(ctx, transactionTimeout)
	defer cancel()
	etcdRes, err := clientInstance.Txn(ctxT).
		If(clientv3.Compare(clientv3.CreateRevision(groupKey(groupName)), ">", 0)).
		Then(clientv3.OpGet(prefix, clientv3.WithPrefix(), clientv3.WithKeysOnly())).
		Commit()

	if err != nil {
		return nil, err
	}
	if !etcdRes.Succeeded {
		return nil, constants.ErrGroupNotFound
	}

	getRes := etcdRes.Responses[0].GetResponseRange()
	members := make([]string, getRes.GetCount())
	for i, kv := range getRes.GetKvs() {
		members[i] = string(kv.Key)[len(prefix):]
	}
	return members, nil
}
376980
func (ip *Interpreter) groupUsers(args []string) {
	items, err := ip.Backend.GroupUsers(args[0])
	ip.userResponder(items, err)
}
1371137
func (s *DBInstance) SetOptionGroupMemberships(v []*OptionGroupMembership) *DBInstance {
	s.OptionGroupMemberships = v
	return s
}
423291
func ReplicaSetMembers(pool *StatePool) ([]replicaset.Member, error) {
	return replicaset.CurrentMembers(pool.SystemState().MongoSession())
}
1331767
func (c *Card) GetMembers(args Arguments) (members []*Member, err error) {
	path := fmt.Sprintf("cards/%s/members", c.ID)
	err = c.client.Get(path, args, &members)
	for i := range members {
		members[i].client = c.client
	}
	return
}
1338785
func (jcm *joinChannelMessage) Members() []api.OrgIdentityType {
	members := make([]api.OrgIdentityType, len(jcm.members2AnchorPeers))
	i := 0
	for org := range jcm.members2AnchorPeers {
		members[i] = api.OrgIdentityType(org)
		i++
	}
	return members
}
322974
func (t *Team) IsMember(userID int64) bool {
	return IsTeamMember(t.OrgID, t.ID, userID)
}
1108734
func (db ErroringDB) IsMember(c context.Context, id identity.Identity, groups []string) (bool, error) {
	logging.Errorf(c, "%s", db.Error)
	return false, db.Error
}
643368
func (c *MemoryGroupService) GroupAddMember(ctx context.Context, groupName, uid string) error {
	memoryGroupsMu.Lock()
	defer memoryGroupsMu.Unlock()

	mg, ok := memoryGroups[groupName]
	if !ok {
		return constants.ErrGroupNotFound
	}

	_, contains := elementIndex(mg.Uids, uid)
	if contains {
		return constants.ErrMemberAlreadyExists
	}

	mg.Uids = append(mg.Uids, uid)
	memoryGroups[groupName] = mg
	return nil
}
896983
func (c *githubConnector) getGroups(ctx context.Context, client *http.Client, groupScope bool, userLogin string) ([]string, error) {
	if len(c.orgs) > 0 {
		return c.groupsForOrgs(ctx, client, userLogin)
	} else if c.org != "" {
		return c.teamsForOrg(ctx, client, c.org)
	} else if groupScope && c.loadAllGroups {
		return c.userGroups(ctx, client)
	}
	return nil, nil
}
892035
func (gs GroupsService) AddMember(groupID, memberID, token string) (Member, error) {
	resp, err := newNetworkClient(gs.config).MakeRequest(network.Request{
		Method:        "POST",
		Path:          fmt.Sprintf("/Groups/%s/members", groupID),
		Authorization: network.NewTokenAuthorization(token),
		Body: network.NewJSONRequestBody(documents.CreateMemberRequest{
			Origin: "uaa",
			Type:   "USER",
			Value:  memberID,
		}),
		AcceptableStatusCodes: []int{http.StatusCreated},
	})
	if err != nil {
		return Member{}, translateError(err)
	}

	var response documents.MemberResponse
	err = json.Unmarshal(resp.Body, &response)
	if err != nil {
		return Member{}, MalformedResponseError{err}
	}

	return newMemberFromResponse(gs.config, response), nil
}
71419
func (o *Me) KeyServerMembers(info *bambou.FetchingInfo) (KeyServerMembersList, *bambou.Error) {

	var list KeyServerMembersList
	err := bambou.CurrentSession().FetchChildren(o, KeyServerMemberIdentity, &list, info)
	return list, err
}
1229526
func (r *HashRing) AddMembers(members ...membership.Member) bool {
	r.Lock()
	changed := false
	var added []string
	for _, member := range members {
		if r.addMemberNoLock(member) {
			added = append(added, member.GetAddress())
			changed = true
		}
	}

	if changed {
		r.computeChecksumsNoLock()
		r.EmitEvent(events.RingChangedEvent{
			ServersAdded: added,
		})
	}
	r.Unlock()
	return changed
}
1146167
func GroupAddMember(ctx context.Context, groupName, uid string) error {
	if uid == "" {
		return constants.ErrEmptyUID
	}
	logger.Log.Debugf("Add user to group %s, UID=%d", groupName, uid)
	return groupServiceInstance.GroupAddMember(ctx, groupName, uid)
}
1043486
func IsMember(c context.Context, groups ...string) (bool, error) {
	if s := GetState(c); s != nil {
		return s.DB().IsMember(c, s.User().Identity, groups)
	}
	return false, ErrNotConfigured
}
19155
func (prj *Project) NumericMembers() (members []uint64) {
	Db().Model(ProjectMember{}).Where(ProjectMember{To: prj.ID()}).Pluck(`"from"`, &members)
	return
}
1034019
func (a *Agent) filterMembers(token string, members *[]serf.Member) error {
	// Resolve the token and bail if ACLs aren't enabled.
	rule, err := a.resolveToken(token)
	if err != nil {
		return err
	}
	if rule == nil {
		return nil
	}

	// Filter out members based on the node policy.
	m := *members
	for i := 0; i < len(m); i++ {
		node := m[i].Name
		if rule.NodeRead(node) {
			continue
		}
		a.logger.Printf("[DEBUG] agent: dropping node %q from result due to ACLs", node)
		m = append(m[:i], m[i+1:]...)
		i--
	}
	*members = m
	return nil
}