<PackageReference Include="System.Security.Permissions" Version="9.0.5" />

AspNetHostingPermission

Controls access permissions in ASP.NET hosted environments. This class cannot be inherited.
public AspNetHostingPermissionLevel Level { get; set; }

Gets or sets the current hosting permission level for an ASP.NET application.

Initializes a new instance of the AspNetHostingPermission class with the specified PermissionState enumeration value.

Initializes a new instance of the AspNetHostingPermission class with the specified permission level.

public bool IsUnrestricted()

Returns a value indicating whether unrestricted access to the resource that is protected by the current permission is allowed.