|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
PermissionObject Interface (Microsoft.Office.Interop.InfoPath)
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.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, see Permission.
Use the PermissionObject class and its members to restrict permissions to the active form and to get or set specific permissions settings.
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.