편집

다음을 통해 공유


PermissionObject Interface

Definition

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

public interface class PermissionObject : Microsoft::Office::Interop::InfoPath::Permission
[System.Runtime.InteropServices.Guid("096CD6CC-0786-11D1-95FA-0080C78EE3BB")]
public interface PermissionObject : Microsoft.Office.Interop.InfoPath.Permission
type PermissionObject = interface
    interface Permission
Public Interface PermissionObject
Implements Permission
Derived
Attributes
Implements

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(String) method is called.

Permissions on a form can also be enabled by using the Add(String, Object, Object) 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.

Properties

Count

Gets the number of UserPermissionObject objects associated with the form.

(Inherited from Permission)
DocumentAuthor

Gets or sets the author of the current form as an e-mail address.

(Inherited from Permission)
Enabled

Gets or sets whether the permission settings represented by the Permission object are enabled for the current form.

(Inherited from Permission)
Item[Object]

Gets the UserPermission object at the specified index.

(Inherited from Permission)
PermissionFromPolicy

Gets whether a permission policy has been applied to the current form.

(Inherited from Permission)
PolicyDescription

Gets a description of the policy that was applied to the current form.

(Inherited from Permission)
PolicyName

Gets the name of the policy that was applied to the current form.

(Inherited from Permission)
RequestPermissionURL

Gets or sets the file, URL, or e-mail address to contact for users who need additional permissions on the current form.

(Inherited from Permission)
StoreLicenses

Gets or sets whether the user's license to view the current form should be cached to allow offline viewing when the user cannot connect to a rights management server.

(Inherited from Permission)

Methods

Add(String, Object, Object)

Creates a new set of permissions on the current form for the specified user with the specified permissions and an expiration date.

(Inherited from Permission)
ApplyPolicy(String)

Applies a policy to the form using a policy template file.

(Inherited from Permission)
GetEnumerator()

Gets an IEnumerator for iterating over the collection.

(Inherited from Permission)
RemoveAll()

Removes all UserPermission objects associated with the form.

(Inherited from Permission)

Applies to