Partager via


LocalReport.SetBasePermissionsForSandboxAppDomain, méthode

Définit les autorisations de base pour le domaine d'application sandbox avec le jeu d'autorisations fourni.

Espace de noms :  Microsoft.Reporting.WinForms
Assembly :  Microsoft.ReportViewer.WinForms (dans Microsoft.ReportViewer.WinForms.dll)

Syntaxe

'Déclaration
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
)

Paramètres

  • permissions
    Type : PermissionSet
    PermissionSet à définir.L'autorisation de base par défaut est Execution.

Notes

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.

Exemples

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)

Voir aussi

Référence

LocalReport Classe

Microsoft.Reporting.WinForms, espace de noms