After tried different combinations of permission levels to them one matched and worked perfect. That was Contribute and Approve permission levels. So, for the logged in users who don't have both of these permission levels the code is failing for them and the result file was not moving successful. [Another note is, I am using publishing site with auto approval of document in document library.]
Code used:
SPFile file = currentItem.File; file.MoveTo(filePath, true);For a document move operation the logged in user should need both Contributor and Approve permission levels for publishing web sites in SharePoint.
I am thinking it is correct according to my analysis and research. Please let me know if something is wrong in this post or any better solutions.
I am trying to do the same thing that is move a document to another folder on approval, can someone help me with the code. I am not a programmer, so your help is much appreciated.
ReplyDelete