The .NET Framework provides two basic models for security: code access based security and role-based security. Code access security describes what the code has permission to do and to which resources it has access. Role-based security controls who has permission to run the code and what they are allowed to do. The CLR supports both of these models using a similar infrastructure. By understanding some of the concepts that are common to both models, you should be able to understand the models better individually.
Three types of permissions exist:
Code access permission
Role-based security permission
Code access permission refers to a class derived from ...