Provides access to UserPermissionObject objects and permission settings that can be applied to a form.
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, seePermission.
Use the PermissionObject class and its members to restrict permissions to the active form and to get or set specific permissions settings.
Because the PermissionObject and its members were added to the Microsoft.Office.Interop.InfoPath.SemiTrust object model in Microsoft InfoPath 2010, you must cast the object returned by the thisXDocument variable to the _XDocument3 type before you can access the PermissionObject and its members. For more information, see How to: Use Microsoft.Office.Interop.InfoPath.SemiTrust Members That Are Not Compatible with InfoPath 2003.
The returned PermissionObject object provides access to the UserPermissionObject objects associated with the form template and each form instance created with that template. Each UserPermissionObject 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 UserPermissionObject object to assign permission on a per-user basis with per-user expiration dates.
The PermissionObject 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 PermissionObject object raises an exception.
Permissions on a form are enabled in one of the following ways by using properties and methods of the PermissionObject 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 cannot be applied when a form is in preview mode. For this reason, all of the properties of the PermissionObject 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, a System.Runtime.InteropServices.COMException is raised and the error "The property/method is not available in preview mode" is returned. Similarly, the methods associated with the PermissionObject and UserPermissionObject objects will also return this error message when used in preview mode.