Edit

Share via


Permission.UserPermissions Property

Definition

Gets a UserPermissionCollection for the current form.

public:
 abstract property Microsoft::Office::InfoPath::UserPermissionCollection ^ UserPermissions { Microsoft::Office::InfoPath::UserPermissionCollection ^ get(); };
public abstract Microsoft.Office.InfoPath.UserPermissionCollection UserPermissions { get; }
member this.UserPermissions : Microsoft.Office.InfoPath.UserPermissionCollection
Public MustOverride ReadOnly Property UserPermissions As UserPermissionCollection

Property Value

A UserPermissionCollection collection that represents the users and their permissions for the current form.

Examples

In the following example, clicking the Button control gets the UserPermissionsCollection for the current form, adds and assigns a user to the Change access level, and sets an expiration date of two days from the current date.

public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
   string strExpirationDate = DateTime.Today.AddDays(2).ToString();
   DateTime dtExpirationDate = DateTime.Parse(strExpirationDate);

   this.Permission.UserPermissions.Add("someone@example.com", 
      PermissionType.Change, dtExpirationDate);
}
Public Sub CTRL1_Clicked(ByVal sender As Object, _
   ByVal e As ClickedEventArgs)
   Dim strExpirationDate As String = _
      DateTime.Today.AddDays(2).ToString()
   dtExpirationDate As DateTime = DateTime.Parse(strExpirationDate)

   Me.Permission.UserPermissions.Add("someone@example.com", _
      PermissionType.Change, dtExpirationDate)
End Sub

Remarks

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Applies to