Security to Developers

Code access security and role-based security are the two main types of security available to developers.

  • Code access security deals with assigning permissions to code, which allows code to access protected resources (such as disk files or the registry) or carry out certain operations (such as accessing unmanaged code). Code access security is built around the notion of permission objects, which control who can access protected resources and what level of access is granted. These permissions are usually based on a permission policy specified by administrators on a given machine or domain.

  • Role-based security deals with identifying the user who is attempting to execute the code, allowing or disallowing certain operations based on the privileges that the user possesses. User identity is the underlying notion, but role-based security also deals with permissions. Identities are closely tied to principals, which contain information as to which roles a user has. The .NET Framework provides an extensible architecture that allows developers to build their own principals and identities for use with .NET role-based security.