What is Code Access Security in .NET

前端 未结 1 2105
被撕碎了的回忆
被撕碎了的回忆 2020-12-16 21:37

What is CAS (Code Access Security) in .NET, and how to achieve it? What are the benefits of using it?

相关标签:
1条回答
  • 2020-12-16 22:10

    In short, CAS is the security sandbox for .NET. Local apps typically have full trust which means they can do anything. .NET apps that are hosted in the browser can't do much. In between, just about any security setting can be fine-tuned using CAS.

    It's benefits: great control over what .NET apps can do, even within the context of the logged in user. The best part about it, IMO, is that security checks walk the stack, so that even if some code has permission to do something, if that method was called by another program that doesn't have permission to do something, that request will fail (unless special measures are taken).

    The downsides: it's a pretty complex beast to learn. Lots of gotchas. But hopefully the links I've provided will lead you to learn whatever details you need to know.

    0 讨论(0)
提交回复
热议问题