Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to publish file using logon user from within elevated code

$
0
0

Hi,

The following piece of code is exceuted with elvated priliveliges.

void Test(SPListItem item)
{
   SPSecurity.RunWithElevatedPrivileges(delegate()
   {
 // Perform few operations on the item.
 SPFile listfile = item.File;
 listfile.Publish("comments");
   });
}

The published version has modified by as system account.
Is there any option to publish the file using logon user from within elevated code?

Thanks in advance,
dhijit


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>