Export (0) Print
Expand All

Permission.UserPermissions property

Gets a UserPermissionCollection for the current form.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract UserPermissionCollection UserPermissions { get; }

Property value

Type: Microsoft.Office.InfoPath.UserPermissionCollection
A UserPermissionCollection collection that represents the users and their permissions for the current form.

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.

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);
}
Show:
© 2014 Microsoft