3

I am getting a SecurityException while trying to activate a feature with a custom timer job. The error is raised from the job.Update() method call. I am running the code with Farm Admin account.

Do you have any idea?

1
  • 1
    To confirm, you are registering the job as part of a feature receiver and activating the feature through CA logged in as the Farm Admin, correct? Dec 4, 2011 at 17:50

2 Answers 2

4

Try to override the SPPersistedObject.HasAdditionalUpdateAccess() method and return true.

protected override bool HasAdditionalUpdateAccess()
{
  return true;
}
0
2

This thread for you. Your application pool identity will not have the appropriate rights. This thread contains full information how to resolve this issue.

2
  • I think the thread doesn't apply to my problem. Because I am trying to install the timer job with the Farm Administrator account which already has full access to both Content DB and SharePoint API. Dec 4, 2011 at 12:08
  • But you try to execute your code from frontend role. In this case your permissions are reduced by security reasons.
    – Alexander
    Dec 4, 2011 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.