Objective was create the custom group,and while creating custom group we need to specify the owner of the group,So we accessed the SPUser object of the owner in this way.This is the best way as there is no need of specifying any hard coded values.
SPUser owner =null;
owner = subSite.SiteGroups.GetByID(int.Parse(subSite.Properties["vti_associateownergroup"]));
Similarly Members group and visitor group can be accessed
SPUser member =null;
owner = subSite.SiteGroups.GetByID(int.Parse(subSite.Properties["vti_associatemembersgroup"]));
SPUser visitor =null;
owner = subSite.SiteGroups.GetByID(int.Parse(subSite.Properties["vti_associatevisitorgroup"]));
No comments:
Post a Comment