PolicyStatement.PermissionSet Property

Definition

Gets or sets the PermissionSet of the policy statement.

public:
 property System::Security::PermissionSet ^ PermissionSet { System::Security::PermissionSet ^ get(); void set(System::Security::PermissionSet ^ value); };
public System.Security.PermissionSet PermissionSet { get; set; }
member this.PermissionSet : System.Security.PermissionSet with get, set
Public Property PermissionSet As PermissionSet

Property Value

The PermissionSet of the policy statement.

Examples

The following code example shows how to use the PermissionSet property to add permissions to the policy statement. This code example is part of a larger example provided for the PolicyStatement class.

NamedPermissionSet^ allPerms = gcnew NamedPermissionSet(
   L"allPerms" );
allPerms->AddPermission( gcnew SecurityPermission(
   SecurityPermissionFlag::Execution ) );
allPerms->AddPermission( gcnew ZoneIdentityPermission(
   SecurityZone::MyComputer ) );
allPerms->AddPermission( gcnew SiteIdentityPermission(
   L"www.contoso.com" ) );

( *policyStatement)->PermissionSet = allPerms;
NamedPermissionSet allPerms = new NamedPermissionSet("allPerms");
allPerms.AddPermission(
    new SecurityPermission(SecurityPermissionFlag.Execution));
allPerms.AddPermission(
    new ZoneIdentityPermission(SecurityZone.MyComputer));
allPerms.AddPermission(
    new SiteIdentityPermission("www.contoso.com"));

policyStatement.PermissionSet = allPerms;
Dim allPerms As New NamedPermissionSet("allPerms")
allPerms.AddPermission( _
    New SecurityPermission(SecurityPermissionFlag.Execution))
allPerms.AddPermission( _
    New ZoneIdentityPermission(SecurityZone.MyComputer))
allPerms.AddPermission( _
    New SiteIdentityPermission("www.contoso.com"))

policyStatement.PermissionSet = allPerms

Applies to