Permission Object
InfoPath Developer Reference |
Provides access to UserPermission objects and permission settings that can be applied to a form.
Version Information
Version Added: InfoPath 2007
Remarks
Use the Permission object and its members to restrict permissions to the active form and to get or set specific permissions settings. An instance of the Permission object associated with a form template is returned by the Permission property of the XDocument object.
The returned Permission object provides access to the UserPermission objects associated with the form template and each form instance created with that template. Each UserPermission object is used to define a specific set of rights for an individual user. While some permissions granted through the user interface apply to all users, you can use the UserPermission object to assign permission on a per-user basis with per-user expiration dates.
The Permission object and its properties and methods are available whether permissions are restricted on the active form template or not. Use the Enabled property to determine whether a form has restricted permissions.
If the Windows Rights Management client is not installed on a user's computer, using the Permission object raises an exception.
Permissions on a form are enabled in one of the following ways by using properties and methods of the Permission object:
- The Enabled property is set to true.
- The DocumentAuthor property is set.
- The RequestPermissionURL property is set.
- The StoreLicenses property is set to true or false.
- The ApplyPolicy method is called.
- Permissions on a form can also be enabled by using the Add method of the Permission object to add a user to the form.
Note |
---|
Permissions cannot be applied when a form is in preview mode. For this reason, all of the properties of the Permission object are read-only when a form is being previewed. In preview mode, the Enabled property will always return false, and if code attempts to change this setting an exception is raised. Similarly, exceptions are raised if the methods associated with the Permission and UserPermission objects are used in preview mode. |
For more information about Information Rights Management (IRM) in InfoPath, see Working with Information Rights Management settings.
See Also