Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Using the ObjectModel to access a list..

  Asked By: Charmaine    Date: Sep 29    Category: Sharepoint    Views: 740

Here is the scenario, UserA has access to a list on a site, but not
access to the site itself.

UserA can access the LIST through a URL, link, etc., but can't access
the site.

I need to duplicate this 'circumstance' in code....

Here is my webpart code...
SPSite sourceSiteColl = new SPSite(_listSite);
SPWeb sourceSitez = sourceSiteColl.OpenWeb();
SPList _list = sourceSitez.Lists[_listName];

If UserA tries access this webpart, a login prompt appears....After
inputting his credentials, an error page appears....

"Access denied. You do not have permission to perform this action or
access this resource.
Access requests are not enabled. "

I can remove the 3rd line in the code (which is very necessary), and
the login prompt won't appear...

Any suggestions on how to fix this or build a better mousetrap would
be helpful...



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Using the ObjectModel to access a list.. Or get search suggestion and latest updates.