public bool VaildateUserBelogtoGroups(string[] groupNames)
{
bool rval = false;
try
{
foreach (string grpName in groupNames)
{
SPGroup ogrp = SPContext.Current.Web.SiteGroups.GetByName(grpName);
if (ogrp.ContainsCurrentUser && rval == false)
rval = true;
}
}
catch (Exception ex)
{
}
return rval;
}
The above method will validate the Current user becomes the Member of Specific Groups.
{
bool rval = false;
try
{
foreach (string grpName in groupNames)
{
SPGroup ogrp = SPContext.Current.Web.SiteGroups.GetByName(grpName);
if (ogrp.ContainsCurrentUser && rval == false)
rval = true;
}
}
catch (Exception ex)
{
}
return rval;
}
The above method will validate the Current user becomes the Member of Specific Groups.
Comments
Post a Comment