Re: Code Access Security

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dmitriy Lapshin [C# / .NET MVP] (x-code_at_no-spam-please.hotpop.com)
Date: 03/03/04


Date: Wed, 3 Mar 2004 12:34:15 +0200

Hi,

> Not necessarily. If the class was being 'used' by other code, you
> would want ensure the code further down the stack had the appropriate
> rights to perform the task in question; a LinkDemand would not achieve
> this.

Excellent correction! Indeed, LinkDemand is good if you want to put a
restriction upon *immediate* callers.

-- 
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"The Poster Formerly Known as Kline Sphere" <.> wrote in message
news:p5g840p7j21l34jbhn94paell44eubphlc@4ax.com...
> On Wed, 25 Feb 2004 15:05:49 +0200, "Dmitriy Lapshin [C# / .NET MVP]"
> <x-code@no-spam-please.hotpop.com> wrote:
>
> >LinkDemand perfectly suits a situation when you need to retrict the use
of
> >your class only to applications known beforehand. Say, you use a modular
> >approach in your app and you've developed an assembly containing some
useful
> >stuff. Since you don't want it to be reused by anyone, you can protect
the
> >stuff with LinkDemand so only callers with a certain public key will be
> >allowed to use it.
>
> Not necessarily. If the class was being 'used' by other code, you
> would want ensure the code further down the stack had the appropriate
> rights to perform the task in question; a LinkDemand would not achieve
> this.
>
> Kline Sphere (Chalk) MCNGP #3