Share via


PermissionObject interface

Provides access to UserPermissionObject objects and permission settings that can be applied to a form.

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

Syntax

'Declaration
<GuidAttribute("096CD6CC-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface PermissionObject _
    Inherits Permission
'Usage
Dim instance As PermissionObject
[GuidAttribute("096CD6CC-0786-11D1-95FA-0080C78EE3BB")]
public interface PermissionObject : Permission

Remarks

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.

An instance of the Permission class associated with a form template is returned by the Permission property of the _XDocument3 class.

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 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 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.

See also

Reference

PermissionObject members

Microsoft.Office.Interop.InfoPath namespace