Using Code Access Security Asserts
The code access security classes include several methods. In addition to the Demand method is the Assert method. .NET security checks to make sure that all callers in a method's call stack have permission to perform a desired operation. This prevents callers that do have permission to perform an operation from performing that operation on behalf of a caller that doesn't have permission. For example, if assembly A (which has permission to modify the registry) calls assembly B's registry modification method, assembly B must have permission to modify the registry too.
Walking the stack to make sure callers have permissions is how the .NET security framework behaves unless you invoke the Assert operation. Assert ...
Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.