Permission Sets

Permission sets allow you to combine multiple IPermission objects together in a single group that can then be collectively manipulated via familiar methods, such as Deny, Demand, and Assert. You may recall we said earlier that you cannot call methods such as Deny and PermitOnly twice in the same stackframe unless there is an intervening reversion. That effectively means that you must work with a permission set if you want to work with two or more permissions at the same time in the same stackframe. We look at the PermissionSet example now, which uses the PermissionSet class to manage multiple permissions simultaneously.

The PermissionSet Class

The PermissionSet class has the same basic set of methods as the IPermission-derived ...

Get .NET Security and Cryptography 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.