Configuration for to grant WebPermission to an ASP.Net 2.0 WebPart?

Discussion in 'ASP .Net Security' started by Martin, Jan 4, 2007.

  1. Martin

    Martin Guest

    Hi,

    I'm writning an ASP.Net 2.0 WebPart, which needs WebPermission.

    I've read http://msdn2.microsoft.com/en-us/library/ms916855.aspx, but still
    get the error

    "Request for the permission of type 'System.Net.WebPermission, System,
    Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. "

    Where can I find documentation on what attributes an I Permission element
    can take?
    I even put in a deliberately bad config
    <IPermission class="WebPermission"
    version="1" >
    <ConnectxxAccess>
    <URI uri=".*" />
    </ConnectxxAccess>
    </IPermission>
    but still get my original error, so perhaps my config is being ignored??

    Any tips appreciated

    Thanks
    Martin
     
    Martin, Jan 4, 2007
    #1
    1. Advertising

  2. the easiest way to figure out the correct syntax is to programmatically create
    a WebPermission class - populate all properties and call ToXml() on it...

    HTH


    -----
    Dominick Baier (http://www.leastprivilege.com)

    > Hi,
    >
    > I'm writning an ASP.Net 2.0 WebPart, which needs WebPermission.
    >
    > I've read http://msdn2.microsoft.com/en-us/library/ms916855.aspx, but
    > still get the error
    >
    > "Request for the permission of type 'System.Net.WebPermission, System,
    > Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    > failed. "
    >
    > Where can I find documentation on what attributes an I Permission
    > element
    > can take?
    > I even put in a deliberately bad config
    > <IPermission class="WebPermission"
    > version="1" >
    > <ConnectxxAccess>
    > <URI uri=".*" />
    > </ConnectxxAccess>
    > </IPermission>
    > but still get my original error, so perhaps my config is being
    > ignored??
    > Any tips appreciated
    >
    > Thanks
    > Marti
     
    Dominick Baier, Jan 4, 2007
    #2
    1. Advertising

  3. Martin

    Martin Guest

    Hi Dominick,

    Thanks for your reply
    I'm bypassing this problem at present.

    Martin
    "Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.com> wrote in
    message news:...
    > the easiest way to figure out the correct syntax is to programmatically
    > create a WebPermission class - populate all properties and call ToXml() on
    > it...
    >
    > HTH
    >
    >
    > -----
    > Dominick Baier (http://www.leastprivilege.com)
    >
    >> Hi,
    >>
    >> I'm writning an ASP.Net 2.0 WebPart, which needs WebPermission.
    >>
    >> I've read http://msdn2.microsoft.com/en-us/library/ms916855.aspx, but
    >> still get the error
    >>
    >> "Request for the permission of type 'System.Net.WebPermission, System,
    >> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    >> failed. "
    >>
    >> Where can I find documentation on what attributes an I Permission
    >> element
    >> can take?
    >> I even put in a deliberately bad config
    >> <IPermission class="WebPermission"
    >> version="1" >
    >> <ConnectxxAccess>
    >> <URI uri=".*" />
    >> </ConnectxxAccess>
    >> </IPermission>
    >> but still get my original error, so perhaps my config is being
    >> ignored??
    >> Any tips appreciated
    >>
    >> Thanks
    >> Martin

    >
    >
     
    Martin, Jan 5, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    0
    Views:
    4,176
    Luis Esteban Valencia
    Jul 14, 2005
  2. Replies:
    1
    Views:
    9,333
    bruce barker \(sqlwork.com\)
    Aug 14, 2006
  3. anars
    Replies:
    0
    Views:
    386
    anars
    Jan 7, 2007
  4. kb
    Replies:
    0
    Views:
    499
  5. SD

    [WSS003] System.Net.WebPermission pb

    SD, Sep 14, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    117
Loading...

Share This Page