문제

문서를 확인할 때 나는 내에서 웹 서비스를 실행합니다. ItemCheckingInEvent. Dev에서는 문제가 없습니다. 앱을 배포했는데 구성 파일을 읽을 수있는 권한이 충분하지 않다는 것이 밝혀졌습니다. 내 코드는 구성 파일을 읽어 WCF 프록시를 만듭니다. 실제 문제는 내가 사용하면 내 함수에서 돌아 오는 방법입니다. SPSecurity.RunWithElevatedPrivileges 기능?

예를 들어:

SPSecurity.RunWithElevatedPrivileges(delegate()
{

      // exec service call

});

// need data from service call here
도움이 되었습니까?

해결책

높은 대의원 전에 작업 물체를 선언하고 내부에 할당하십시오.

object myServiceData = null;

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

//do things with myServiceData
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top