Sharepoint Privileges

When validating a document, I am executing a web service in ItemCheckingInEvent

. Dev has no problem. I deployed the application and it turned out that I did not have enough rights to read the configuration file. My code reads a config file to create a WCF proxy. The real problem is, how can I get the return from my function if I use a function SPSecurity.RunWithElevatedPrivileges

?

For instance:

SPSecurity.RunWithElevatedPrivileges(delegate()
{

      // exec service call

});

// need data from service call here

      

+1


a source to share


1 answer


Just declare your work object in front of the added delegate and assign it inside:



object myServiceData = null;

SPSecurity.RunWithElevatedPrivileges(delegate()
{
      myServiceData = DoServiceStuff();
});

//do things with myServiceData

      

+3


a source







All Articles