Guest
|
Posted:
Tue Oct 25, 2005 8:51 am Post subject:
Access Denied When Checking User Rights |
|
|
I have created a Windows application with the test code below. Then I
log onto the SharePoint server with the Administrator account for the
domain which also is Administrator in SharePoint and I have also added
the Administrator account to the site in SharePoint that I'm accessing
with all rights. But when I execute the application I get an Access
Denied exception. What should I do to get access? I have no clue of
what to do next.
SPSite site = new
SPSite("http://MySharePointServer/MySite/default.aspx");
SPWeb web = site.OpenWeb();
foreach (SPRole role in web.Roles)
{
foreach (SPUser user in role.Users)
{
myListBox.Items.Add(user.Name);
}
} |
|