Permission Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides access to the UserPermissionCollection and permission settings that can be applied to a form.
public ref class Permission abstract
public abstract class Permission
type Permission = class
Public MustInherit Class Permission
- Inheritance
-
Permission
Remarks
Use the Permission 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 Microsoft.Office.InfoPath.Xmlform.Permission property of the XmlForm class. The returned Permission object provides access to the collection of 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 class raises an exception.
Permissions on a form are enabled in one of the following ways by using properties and methods of the Permission class:
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 one of the Add(String) methods of the UserPermissionCollection class to add a user to the form's user permissions collection.
Note: Permissions cannot be applied when a form is in preview mode. For this reason, all of the properties of the Permission class 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 properties and methods associated with the UserPermission and UserPermissionCollection classes will also return this error message when used in preview mode.
Constructors
Permission() |
Properties
DocumentAuthor |
Gets or sets the author of the current form as an e-mail address. |
Enabled |
Gets or sets whether the permission settings represented by the Permission object are enabled for the current form. |
PermissionFromPolicy |
Gets whether a permission policy has been applied to the current form. |
PolicyDescription |
Gets a description of the policy that was applied to the current form. |
PolicyName |
Gets the name of the policy that was applied to the current form. |
RequestPermissionUrl |
Gets or sets the file, URL, or e-mail address to contact for users who need additional permissions on the current form. |
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. |
UserPermissions |
Gets a UserPermissionCollection for the current form. |
Methods
ApplyPolicy(String) |
Applies a policy to the form using a policy template file. |