Given a list name "User Data" and setting Item-Level Permissions to "Only their own" for read and edit.
How can I as a site owner see only my own items on that list when using the SharePoint Object Model? Basically I want to store a small amount of user maintainable data and display that through a web part.
SPList list = web.Lists["User Data"];
if (list != null)
{
foreach (SPListItem item in list.Items)
{
// How to limit this for admin accounts to not see everything
// Maybe using SPQuery instead or something?
}
}
I guess another interesting question is, how do I tell if the current user has the "Manage Lists" permission and do some custom query?