Hi,
I am developing a custom webpart for sharepoint.I have to show all the links of sites and subsites of which currently logged in user has edit rights.I have been able to do this for users whose name exists in sharepoint people and groups section,but don't know how to do for users who is a part of some DL and we have given access to DL in people and groups section.
My sample code is written below:
string UserLogin = System.Web.HttpContext.Current.User.Identity.Name.ToString();
SPUserCollection allUsers = community.Users;
foreach (SPUser user in allUsers)
{
if (user.LoginName.ToUpper() == UserLogin.ToUpper())
{
SPRoleCollection allGroups = user.Roles;
foreach (SPRole group in allGroups)
{ bool isUserAllowed;
isUserAllowed = community.Permissions.DoesUserHavePermissions(SPRights.ViewListItems);
if(isUserAllowed.Equals(true))
{
string strStatus = "User " + UserLogin + " has Reader permissions in /" + community.Title + ".";
}
}
}