This is my code:
if (docLib.DoesUserHavePermissions(SPBasePermissions.DeleteVersions))
{
item.File.CheckIn(comment, SPCheckinType.OverwriteCheckIn);
}
else
{
item.File.CheckIn(comment);
}
I have versioning enabled for a document library. Let's say I have User Bobby, he does not have delete versions permissions and when he wants to upload and check in the document, there will be two versions of that document.
The issue is that Bobby does not have delete versions permissions, so using OverwriteCheckIn will throw an Access Denied error.
Anyone has any solution?