Montag, 20. Oktober 2008

Activating custom timer jobs as a feature

When you are developing custom timer jobs and deploy them as a feature, you have to make sure it is a "WebApplication"- or "Farm"-Feature.
If you try to activate a feature with a custom timer job from inside a SharePoint Site, you will get the following error: The EXECUTE permission was denied on the object 'proc_putObject'

Of course, there are several possible ways, how to work around this issue:
  • You could give the IIS Application Pool User Account the appropriate permission
  • You could turn off unsafe updates in your code
  • You could change the permissions of your SharePoint config database

Everyone of these actions breaks the rule of separated permissions. The right way would be to rescope your feature and activate it through Central Administration. Ideally, it is another person who has to activate the feature, as well (namely the Farm Admin ;-)).