如果我在spjobdefinition中使用runwithelevatepriveile,这是否重要?
-
10-12-2019 - |
题
我已经写了一个自定义生成的SPJobDefinition
。在public override void Execute(Guid targetInstanceId)
方法中,我正在运行一些代码,该代码封装在SPSecurity.RunWithElevatedPrivileges
中。由于作业在App Pool帐户下执行(这是一个真实的陈述,右?),因此在系统帐户下运行它的益处/目的是什么?
解决方案
从msdn vithing spsecurity.runwithelevateprivileges
即使用户没有完全控制,也具有完全控制权的指定方法
作业在SharePoint Timer服务帐户下执行。此帐户可能没有完全控制权限。它的权限可能受到限制。
其他提示
请参阅这些讨论......我希望你能得到答案。
https:/stackoverflow.com/questions/1036589/probled-in-creating-timer-job http://social.msdn.microsoft.com/forums/sharepoint/en-us/696a640f-4b8d-44ce-a970-e05bd45c437f/timer-job-and-runwithelevatedpriviliges https://stackoverflow.com/questions/1340771/runwithelevatedprivileges-in-sharepoint-timer-jobs