Represents the security policy levels for the common language runtime. This class cannot be inherited.
public ref class PolicyLevel sealed
[System.Runtime.InteropServices.ComVisible(true)] [System.Serializable] public sealed class PolicyLevel
type PolicyLevel = class
Public NotInheritable Class PolicyLevel
Starting with the .NET Framework 4, the common language runtime (CLR) is moving away from providing security policy for computers. We recommend that you use Windows Software Restriction Policies (SRP) or AppLocker as a replacement for CLR security policy. The information in this topic applies to the .NET Framework version 3.5 and earlier; it does not apply to the .NET Framework 4 and later. For more information about this and other changes, see Security Changes.
The highest level of security policy is enterprise-wide. Successive lower levels of hierarchy represent further policy restrictions, but can never grant more permissions than allowed by higher levels. The following policy levels are implemented:
Enterprise: Security policy for all managed code in an enterprise.
Machine: Security policy for all managed code run on the computer.
User: Security policy for all managed code run by the user.
Application domain: Security policy for all managed code in an application.
A policy level consists of a set of code groups organized into a single rooted tree (see CodeGroup), a set of named permission sets that are referenced by the code groups to specify permissions to be granted to code belonging to the code group, and a list of fully-trusted assemblies.
Use SecurityManager.PolicyHierarchy to enumerate the policy levels.
|FullTrustAssemblies FullTrustAssemblies FullTrustAssemblies FullTrustAssemblies||
Gets a list of StrongNameMembershipCondition objects used to determine whether an assembly is a member of the group of assemblies used to evaluate security policy.
|Label Label Label Label||
Gets a descriptive label for the policy level.
|NamedPermissionSets NamedPermissionSets NamedPermissionSets NamedPermissionSets||
Gets a list of named permission sets defined for the policy level.
|RootCodeGroup RootCodeGroup RootCodeGroup RootCodeGroup||
Gets or sets the root code group for the policy level.
|StoreLocation StoreLocation StoreLocation StoreLocation||
Gets the path where the policy file is stored.
|Type Type Type Type||
Gets the type of the policy level.