There are two types of security features provided by the .NET framework so that our code also secured from unauthorized users:
- Role Based Security
- Code Access Security
Role Based Security authorize the specific user to perform an action. It enables you to check that the available user is authenticated with in windows and also must be a part of a group with in a domain.
Code Access Security or CAS protects code from the unauthorized calls. Permission object can be used to prevent system resource access which specify the user and its role . CAS does not replace the role based security instead it augments the RB Security.
The main difference between the two is -
The RB security is implemented by you on your code and the CAS is implemented by the system itself.

Join the conversation! Your thoughts help the community grow.