Does anyone have experience with code access security?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ramzey

    #1

    Does anyone have experience with code access security?

    I've looked through the MSDN documentation on code access security and
    can not seem to find an answer to my question.

    I have a class XYZCorpWebPage that uses System.Web.UI.P age as it's
    base class. I want to make it so that the web server will throw an
    exception/deny runtime rights to any WebForm derived from
    System.Web.UI.P age, but I want to allow runtime rights on
    XYZCorpWebPage (I want to force our developers to use XYZCorpWebPage
    as their base class).

    Can this be done using the .NET Configuration Wizards? I only see
    access to increase trust in an Assembly and I'm not sure how it will
    resolve the conflict.
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Does anyone have experience with code access security?

    Ramzey,

    You can't do it. The reason for this is that you would have to be able
    to modify System.Web.UI.P age to modify the permissions it demands. You
    don't have access to this, so you can't change it.

    What I would do is create a class that implements IHttpHandler that will
    then create the appropriate class and check to make sure that it derives
    from your type.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Ramzey" <jeremy_deats@h otmail.com> wrote in message
    news:d393d1b1.0 307250944.62780 c14@posting.goo gle.com...[color=blue]
    > I've looked through the MSDN documentation on code access security and
    > can not seem to find an answer to my question.
    >
    > I have a class XYZCorpWebPage that uses System.Web.UI.P age as it's
    > base class. I want to make it so that the web server will throw an
    > exception/deny runtime rights to any WebForm derived from
    > System.Web.UI.P age, but I want to allow runtime rights on
    > XYZCorpWebPage (I want to force our developers to use XYZCorpWebPage
    > as their base class).
    >
    > Can this be done using the .NET Configuration Wizards? I only see
    > access to increase trust in an Assembly and I'm not sure how it will
    > resolve the conflict.[/color]


    Comment

    Working...