Upvoted, since I would indeed like to see this in the public API. For the benefit of others needing this information, it is located in the PermissionGroup and PermissionGroupMembership tables. The database schema is documented at http://fogbugz.stackexchange.com/fogbugz-database-schema.
Remember, if you're going to query these tables directly, you're query will need IgnorePermissions set to true.
Example of getting available groups:
public System.Data.DataSet listGroups (CPluginApi api) {
CSelectQuery groupQuery = api.Database.NewSelectQuery("PermissionGroup");
groupQuery.IgnorePermissions = true;
System.Data.DataSet groupDataSet = groupQuery.GetDataSet();
return groupDataSet;
}
And getting the members of a group:
public System.Data.DataSet listGroupMembers (CPluginApi, ixPermissionGroup) {
CSelectQuery groupMemberQuery = api.Database.NewSelectQuery("PermissionGroupMember");
groupMemberQuery.AddWhere("ixPermissionGroup=@ixPermissionGroup");
groupMemberQuery.SetParam("@ixPermissionGroup", ixPermissionGroup);
groupMemberQuery.IgnorePermissions = true;
System.Data.DataSet groupMemberDataSet = groupMemberQuery.GetDataSet();
return groupDataSet;
}
Of course, if you want the names of the members, or want to query by the name of the group, then you'll want to do the appropriate joins and / or use the CPersonApi to get the name and details of the group member.