I have a web part that lists users who are members of a sharepoint group that has rights to a list.
It is very convenient to add FBA users to roles when creating them with your SharePoint 2010 FBA Pack, but when I try to list SPUsers for the FBA SPGroup, I only pull the FBA role name, and don't get the role members.
If I add an FBA user to an SharePoint Group directly without using a role, then the code works fine and I see the users.
So I think I either need to figure out how to list the members of a role programmatically, or I think I'd like to modify the FBA user creation dialog to provide a list of SPGroups instead of, or in addition to, the list of roles.
Here's a snippet from the code which lists the members of an SPGroup. But when I run this and it hits an FBA role, It shows the FBA group, but does not show the members; indeed, it lists the group itself as a user
// if the SPGroup grpRoleGroup has at least one member..
if (grpRoleGroup.Users.Count > 0)
string strGroupName = grpRoleGroup.Name;
// add each user to the report table string
foreach (SPUser usrUser in grpRoleGroup.Users)
permReport = permReport + "<tr><td width=\"33%\">" +
grpRoleGroup.Name.ToString() + "</td><td>" +
usrUser.LoginName.ToString() + "</td><td>" +
usrUser.Name.ToString() + "</td></tr>";