//Get the current loged in user
SPUser currentUser = SPContext.Current.Web.CurrentUser;
using (SPSite site = new SPSite("http:\\servername\TestSite"))
{
site.AllowUnsafeUpdates = true;
using (SPWeb web = site.OpenWeb())
{
SPList oList = web.Lists["Test"];
if(oList!=null)
{
SPListItemCollection collListItems=lstAPAs.GetItems();
if(collListItems!=null)
{
foreach (SPListItem oListItem in collListItems)
{
bool Ispermission = Convert.ToBoolean(oListItem.DoesUserHavePermissions (currentUser, SPBasePermissions.EditListItems));
if(Ispermission)
{
//Current user has edit permission for the list item
}
else
{
//Current User doen't have permission for the list item
}
}
}
}
site.AllowUnsafeUpdates = false;
}
}
SPUser currentUser = SPContext.Current.Web.CurrentUser;
using (SPSite site = new SPSite("http:\\servername\TestSite"))
{
site.AllowUnsafeUpdates = true;
using (SPWeb web = site.OpenWeb())
{
SPList oList = web.Lists["Test"];
if(oList!=null)
{
SPListItemCollection collListItems=lstAPAs.GetItems();
if(collListItems!=null)
{
foreach (SPListItem oListItem in collListItems)
{
bool Ispermission = Convert.ToBoolean(oListItem.DoesUserHavePermissions (currentUser, SPBasePermissions.EditListItems));
if(Ispermission)
{
//Current user has edit permission for the list item
}
else
{
//Current User doen't have permission for the list item
}
}
}
}
site.AllowUnsafeUpdates = false;
}
}