SPSecurity.RunWithElevatedPrivileges error out - InfoPath Dev
in

InfoPath Dev

SPSecurity.RunWithElevatedPrivileges error out

Last post 06-19-2008 02:00 PM by iii1682000. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-18-2008 11:44 AM

    SPSecurity.RunWithElevatedPrivileges error out

    Hi,

     I am trying to assign roles to a document library item from InfoPath code and have issues with it

    If I call

    using (SPSite site = new SPSite(http://mysite_url)) (where http://mysite_url is the site on the local machine I am coding)

    it complains the site doesn't exsit (and it surely does) 

    Then I was trying to wrap everying (myfunction) into  SPSecurity.RunWithElevatedPrivileges(), now I get an exception "Object reference not set to an instance of an object" on the line SPSecurity.RunWithElevatedPrivileges(myfunction),

    This is so weird, does anybody know why?

     

  • 06-19-2008 01:14 PM In reply to

    Re: SPSecurity.RunWithElevatedPrivileges error out

    Any help or advice yet?

  • 06-19-2008 01:41 PM In reply to

    Re: SPSecurity.RunWithElevatedPrivileges error out

    Hey here is a hint of another version of my qestion about this error:

    I am pretty much sure it's a security issue. I am
    runing InfoPath 2007. Question and hint: What user identity and
    application pool to run the InfoPath web form or service. How should I
    know that?

    I need to check the identity or impersonate an admin user to do this.

    How to do impersonation in InfoPath form. I added a block of code in the infopath.exe.config in my local development machine and the web.config of the virtual directory of the stage machine, none of them works

    <system.web>
      <identity impersonate="true" userName="OurDomain\OurAdminAccount" password="xxxxxxxx" />
     </system.web>

    Any idea?

     

  • 06-19-2008 02:00 PM In reply to

    Re: SPSecurity.RunWithElevatedPrivileges error out

    A even much simpler version of my question:

    Is that possible to access SPSite and SPWeb object from InfoPath Code (FormCode.cs)? How?

     

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.