What is CAS (Code Access Security) in .NET, and how to achieve it? What are the benefits of using it?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With