UrlCodeGroup Class
Represents a code group that grants permissions based on the URL from which the code originates.
Syntax
public sealed class UrlCodeGroup : CodeGroup
Requirements
Assembly: System.dll Namespace: System.Net.Security Platform: Windows, Linux, macOS
Remarks
The UrlCodeGroup class is used in the Code Access Security (CAS) model of the .NET Framework to define security policies. It allows administrators to grant specific permissions to code based on the uniform resource locator (URL) from which it was loaded.
When code is loaded from a specific URL, the UrlCodeGroup can be evaluated to determine the set of permissions that should be granted to that code. This is particularly useful for managing security in environments where code might be downloaded from various network locations.
Constructors
public UrlCodeGroup(System.Security.Policy.IMembershipCondition membershipCondition)
Initializes a new instance of the UrlCodeGroup class with the specified membership condition.
protected UrlCodeGroup(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
Initializes a new instance of the UrlCodeGroup class from serialized data.
Methods
public override System.Security.IPermission CreateIdentityPermission(System.Security.Policy.Evidence evidence)
Creates and returns a new permission object that represents the permissions granted by the code group, based on the specified evidence.
public override System.Security.Policy.CodeGroup Copy()
Creates a new code group with the same membership condition and child code groups as the current code group.
public override System.Security.Policy.PolicyStatement Punt(System.Security.Policy.Evidence evidence)
Determines whether the specified evidence can be used to determine the policy, and if so, returns the policy statement; otherwise, returns null.
Fields
This class has no public fields.
Properties
public override string MergeLogic { get; }
Gets the merging logic for the code group. Always returns "Strongest".