<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.2.20160.6" />

PolicyLevel

public sealed class PolicyLevel
Represents the security policy levels for the common language runtime. This class cannot be inherited.
public IList FullTrustAssemblies { get; }

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.

public string Label { get; }

Gets a descriptive label for the policy level.

public IList NamedPermissionSets { get; }

Gets a list of named permission sets defined for the policy level.

public CodeGroup RootCodeGroup { get; set; }

Gets or sets the root code group for the policy level.

public string StoreLocation { get; }

Gets the path where the policy file is stored.

public PolicyLevelType Type { get; }

Gets the type of the policy level.

Creates a new policy level for use at the application domain policy level.

Adds a StrongNameMembershipCondition corresponding to the specified StrongName to the list of StrongNameMembershipCondition objects used to determine whether an assembly is a member of the group of assemblies that should not be evaluated.

Adds the specified StrongNameMembershipCondition to the list of StrongNameMembershipCondition objects used to determine whether an assembly is a member of the group of assemblies that should not be evaluated.

Adds a NamedPermissionSet to the current policy level.

Replaces a NamedPermissionSet in the current policy level with the specified PermissionSet.

public void FromXml(SecurityElement e)

Reconstructs a security object with a given state from an XML encoding.

Returns the NamedPermissionSet in the current policy level with the specified name.

public void Recover()

Replaces the configuration file for this PolicyLevel with the last backup (reflecting the state of policy prior to the last time it was saved) and returns it to the state of the last save.

Removes an assembly with the specified StrongName from the list of assemblies the policy level uses to evaluate policy.

Removes an assembly with the specified StrongNameMembershipCondition from the list of assemblies the policy level uses to evaluate policy.

Removes the specified NamedPermissionSet from the current policy level.

Removes the NamedPermissionSet with the specified name from the current policy level.

public void Reset()

Returns the current policy level to the default state.

public PolicyStatement Resolve(Evidence evidence)

Resolves policy based on evidence for the policy level, and returns the resulting PolicyStatement.

Resolves policy at the policy level and returns the root of a code group tree that matches the evidence.

Creates an XML encoding of the security object and its current state.