_XDocument4.Permission 属性

定义

获取对 PermissionObject 与窗体关联的 对象的引用。

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::PermissionObject ^ Permission { Microsoft::Office::Interop::InfoPath::SemiTrust::PermissionObject ^ get(); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.PermissionObject Permission { get; }
member this.Permission : Microsoft.Office.Interop.InfoPath.SemiTrust.PermissionObject
Public ReadOnly Property Permission As PermissionObject

属性值

一个 PermissionObject 对象,表示信息权限管理 (IRM) 窗体的权限设置。

实现

示例

在以下示例中, Permission 属性返回当前窗体的 PermissionObject 对象,该对象随后使用 Enabled 属性显示是否为当前窗体启用了权限设置。

_XDocument4 thisDoc = (_XDocument4)thisXDocument;
thisXDocument.UI.Alert(
   thisDoc.Permission.Enabled.ToString());
Dim thisDoc As _XDocument4 = _
   DirectCast(thisXDocument, _XDocument4)
thisXDocument.UI.Alert(
   thisDoc.Permission.Enabled.ToString())

在以下示例中, Permission 属性返回当前窗体的 PermissionObject 对象,该对象随后使用 Enabled 属性显示是否为当前窗体启用了权限设置。

_XDocument4 thisDoc = (_XDocument4)thisXDocument;
thisXDocument.UI.Alert(
   thisDoc.Permission.Enabled.ToString());
Dim thisDoc As _XDocument4 = _
   DirectCast(thisXDocument, _XDocument4)
thisXDocument.UI.Alert(
   thisDoc.Permission.Enabled.ToString())

注解

在返回对 PermissionObject 对象的引用后,可以使用该引用限制对活动表单的权限以及返回或设置特定的权限设置,例如是否可以编辑、复制或打印表单中的数据。

由于 Permission 属性是 Microsoft Office InfoPath 2007 中的新增属性,因此必须声明并强制转换为 _XDocument4 类型才能访问此属性。 有关详细信息,请参阅如何:使用与 InfoPath 2003 不兼容的对象模型成员。

此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。

适用于