I'm extending the Examine content when saving members and need to save the roles of the member in Examine to perform fast membersearches.
There are 2 roles i need to index:
private void IndexCustomMemberData(object sender, IndexingNodeDataEventArgs e)
{
var memberservice = ApplicationContext.Current.Services.MemberService;
var thisMember = memberservice.GetById(int.Parse(e.Fields["id"]));
var groups = System.Web.Security.Roles.GetRolesForUser(thisMember.Username);
var isGroupA = groups.Contains("GroupA");
var isGroupB = groups.Contains("GroupB");
e.Fields.Add("GroupA", isGroupA ? "1" : "0");
e.Fields.Add("GroupB", isGroupB ? "1" : "0");
}
The problem is that de groups variable contains the groups from before the save method. If a add a group to a member, after the first Save, the group will not be added, only from the second save.
Any idea how i can get this newly assigned groups immediately?
Save Groups (roles) of members in Examine
Hi,
I'm extending the Examine content when saving members and need to save the roles of the member in Examine to perform fast membersearches.
There are 2 roles i need to index:
The problem is that de groups variable contains the groups from before the save method. If a add a group to a member, after the first Save, the group will not be added, only from the second save.
Any idea how i can get this newly assigned groups immediately?
Thanks!
is working on a reply...