我一直在使用PoC in SharePoint,在处理文档库中添加或更新的项目的EventReceiver上,必须将文件复制到临时文件夹中。
我想知道,有没有一种方法可以知道哪个用户将在文件夹中写入文件?因为这可能在不同的服务器上工作,所以必须授予权限。
发布于 2013-08-02 19:22:09
对所有磁盘操作使用SPSecurity.RunWithElevatedPrivileges,因为传入的用户不太可能拥有将任何内容写入服务器文件系统的权限。
SPSecurity.RunWithElevatedPrivileges(delegate()
{
// open/write/close file here.
// Avoid touching SPxxxx objects from outside of this delegate
});https://stackoverflow.com/questions/18024420
复制相似问题