Freigeben über


LocalReport.SetBasePermissionsForSandboxAppDomain-Methode

Legt die Basisberechtigungen für die Sandbox-Anwendungsdomäne mit dem angegebenen Berechtigungssatz fest.

Namespace:  Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Syntax

'Declaration
Public Sub SetBasePermissionsForSandboxAppDomain ( _
    permissions As PermissionSet _
)
public void SetBasePermissionsForSandboxAppDomain(
    PermissionSet permissions
)
public:
void SetBasePermissionsForSandboxAppDomain(
    PermissionSet^ permissions
)
member SetBasePermissionsForSandboxAppDomain : 
        permissions:PermissionSet -> unit 
public function SetBasePermissionsForSandboxAppDomain(
    permissions : PermissionSet
)

Parameter

  • permissions
    Typ: PermissionSet
    Die festzulegende PermissionSet.Die Standardbasisberechtigung ist Ausführung.

Hinweise

The base permissions in the sandboxed application domain apply to custom code assemblies and the evaluation of report expressions. Note that this method replaces any existing base permission set with the supplied permission set. You should make sure that the supplied permission set includes the Execution permission. Otherwise, no custom code assemblies can be executed and no expressions can be evaluated.

If you change the permissions, make sure that the LocalReport object cannot be used to access any untrusted report definitions. In .NET Framework 3.5 (or in .NET Framework 4 with LegacySecurityPolicy enabled), you must explicitly call the ExecuteReportInSandboxAppDomain method to switch to the sandboxed application domain mode.

Beispiele

The following code adds file input and output permissions to the default base permission set.

PermissionSet permissions = new PermissionSet(PermissionState.None);
permissions.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));

ReportViewer1.LocalReport.SetBasePermissionForSandboxAppDomain(permissions);
Dim permissions As New PermissionSet(PermissionState.None)
permissions.AddPermission(New FileIOPermission(PermissionState.Unrestricted))
permissions.AddPermission(New SecurityPermission(SecurityPermissionFlag.Execution))

ReportViewer1.LocalReport.SetBasePermissionForSandboxAppDomain(permissions)

Siehe auch

Referenz

LocalReport Klasse

Microsoft.Reporting.WinForms-Namespace