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

AspNetHostingPermissionAttribute

Allows security actions for AspNetHostingPermission to be applied to code using declarative security. This class cannot be inherited.
public AspNetHostingPermissionLevel Level { get; set; }

Gets or sets the current hosting permission level.

Initializes a new instance of the AspNetHostingPermissionAttribute class.