开发者

AccessDenied.aspx / List does not exist on list that user has access to

开发者 https://www.devze.com 2023-02-03 02:30 出处:网络
I am getting this error: List does not exist The page you selected contains a list that does not exist.It may have been deleted by another user.at Microsoft.SharePoint.Library.SPRequestInternalClass.

I am getting this error:

List does not exist The page you selected contains a list that does not exist. It may have been deleted by another user. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListsWithCallback...

Unfortunately it's not the unpublished masterpage manifestation of the error - the list GUID in the query string leads to one of several lists in the root web that are used to display user settings in controls on the master page.

The list is being accessed using the following code:

_RootWeb = SPContext.Current.Site.RootWeb;
storageList = _RootWeb.GetList(_RootWeb.Url + "/Lists/" + 
                              LocalStrings.TimeZoneStorageList.ListName);
SPListItemCollection result = list.GetItems(query);
SPListItem StorageItem = result[0];

xmlDoc.LoadXml(StorageItem[LocalStrings.TimeZoneStorageList.Fields.UserXML]
                                                                   .ToString());

Is there anything that could cause that code to throw an AccessDeniedException while the user is able to access the list through the UI?

Alter开发者_开发技巧natively, is it possible for SharePoint to report a list as the source of the error when the permissions issue is actually somewhere else entirely?


Is there anything that could cause that code to throw an AccessDeniedException while the user is able to access the list through the UI?

This might not apply in your case, but yes, I have had this happen with:

  1. Lookup fields where the user did not have permissions to the lookup list
  2. People fields filtered to a chosen SharePoint Group where the user did not have permissions to view the membership of the group.

In both cases, these fields were not included in the views or forms normally used by the user so the problem was not immediately discovered.


Can you try getting your list as

_RootWeb.Lists[strListName]

where strListName is the Title of the list.


The List ID in the query string on AccessDenied.aspx can in fact be unrelated to the actual error. The relevant code was something like

try {
    throw new AccessDeniedException();
    } 
catch (Exception ex) {}

storageList = _RootWeb.GetList(ListUrl);  

If CatchAccessDeniedException is not disabled, SharePoint will see the exception despite the catch and abort the thread. Since this is controlled on another thread, it's not synchronous and the code continues to run long enough that the thread aborts in the middle of accessing the list.

Both parts of the error message are technically correct - There was an AccessDeniedException, and the last operation was trying to open the list - but there is no actual connection between the two.

The actual problem turned out to be service account permissions on mysites, which naturally never appeared in any logs or error messages.


The issue for me was quite simple. I had a user who had permissions to the current site, which was fine. However, there was a list web part on the page I got the error that accessed items from a sub site in which the current user didn't have access.

In my case the error should have read "access denied for list".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号