System.Security.Permissions

A permission is an object that specifies security rules for access to a protected resource. Permissions come in two flavors, programmatic and declarative. In the former case, the permission class (e.g., EnvironmentPermission), derives from CodeAccessPermission. You write code that creates these objects, sets their properties, and calls their methods in the usual way. You will need this technique when your security operations can vary dynamically at runtime.

Alternatively, many programmers like to specify their permissions declaratively by marking their code with attributes. The attributes tell the CLR which security permissions the code needs to do its job, in the same way that calling methods on a permission object ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library 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.