Word.LabelingCapability enum
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
表示敏感度标签目录的标记功能状态。
注解
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-sensitivity-labels.yaml
// Check whether sensitivity labeling is available for the current user.
await Word.run(async (context) => {
const labelCatalog: Word.SensitivityLabelsCatalog = context.sensitivityLabelsCatalog;
if (!labelCatalog) {
console.warn("The sensitivity label catalog isn't available.");
return;
}
labelCatalog.load("getLabelingCapability");
await context.sync();
switch (labelCatalog.getLabelingCapability) {
case Word.LabelingCapability.labelingEnabled:
console.log("Sensitivity labeling is enabled.");
break;
case Word.LabelingCapability.labelingDisabled:
console.log("Sensitivity labeling is disabled.");
break;
case Word.LabelingCapability.labelingPolicyNotFound:
console.log("No sensitivity labeling policy was found.");
break;
case Word.LabelingCapability.noLicense:
console.log("The current user doesn't have a valid sensitivity labeling license.");
break;
default:
console.log(`Unknown labeling capability: ${labelCatalog.getLabelingCapability}`);
break;
}
});
字段
| attributeBasedAccessControlEnabled = "AttributeBasedAccessControlEnabled" | 为敏感度标签启用了基于属性的访问控制。 |
| labelingDisabled = "LabelingDisabled" | 已为用户或租户禁用敏感度标签。 |
| labelingEnabled = "LabelingEnabled" | 已完全启用敏感度标签。 |
| labelingPolicyNotFound = "LabelingPolicyNotFound" | 找不到用户的标记策略。 |
| noLicense = "NoLicense" | 没有可用于敏感度标签的有效许可证。 |