I am an admin on the box and also Administrator on the SharePoint
Portal server. But while retrieving the user roles from the SPWeb
object, I get the error "Access is denied".
Here is the code :
foreach (SPRole role in SPWEB.Roles)
{
foreach(SPUser user in role.Users)
{
Response.Write(user.LoginName);
}
}
Exception is thrown on reading role.Users.
Any idea why this is happening? Since I am an admin I shouldn't be
seeing this error?