Question

I have written a custom SPJobDefinition. In the public override void Execute(Guid targetInstanceId) method I am running some code which is encapsulated in SPSecurity.RunWithElevatedPrivileges. Since the jobs are executed under the app pool account (this is a true statement, right?), what is the benefit/purpose of running it under System Account?

Was it helpful?

Solution

From msdn about SPSecurity.RunWithElevatedPrivileges

Executes the specified method with Full Control rights even if the user does not otherwise have Full Control

Jobs are executed under SharePoint timer service account. This account could have not full control permissions. It's permissions could be restricted.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top