<PackageReference Include="System.Security.Permissions" Version="10.0.0-rc.2.25502.107" />

ReflectionPermission

Controls access to non-public types and members through the Reflection APIs. Controls some features of the Emit APIs.
public ReflectionPermissionFlag Flags { get; set; }

Gets or sets the type of reflection allowed for the current permission.

Initializes a new instance of the ReflectionPermission class with either fully restricted or unrestricted permission as specified.

Initializes a new instance of the ReflectionPermission class with the specified access.

public bool IsUnrestricted()

Returns a value indicating whether the current permission is unrestricted.