SPSite siteCollection = new SPSite("http://localhost");
SPWeb ParentWeb = siteCollection.OpenWeb("/");
SPUserCollection allUsers = ParentWeb.Users;
foreach ( SPUser user in allUsers) {
if (user.LoginName.ToLower() == "sandeep") {
SPRoleCollection allGroups = user.Roles;
foreach ( SPRole role in allRoles) {
int right = group.PermissionMask & SPRights.ViewListItems;
if (right == SPRights.ViewListItems) {
Console.Write("User has Reader permissions.");
}
}
}
}
Tuesday, September 23, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment