Word.LabelingCapability enum
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Represents the labeling capability status of the sensitivity label catalog.
Remarks
API set: WordApi BETA (PREVIEW ONLY)
Used by
Examples
// 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;
}
});
Fields
| attributeBasedAccessControlEnabled = "AttributeBasedAccessControlEnabled" | Attribute-based access control is enabled for sensitivity labeling. |
| labelingDisabled = "LabelingDisabled" | Sensitivity labeling is disabled for the user or tenant. |
| labelingEnabled = "LabelingEnabled" | Sensitivity labeling is fully enabled. |
| labelingPolicyNotFound = "LabelingPolicyNotFound" | No labeling policy was found for the user. |
| noLicense = "NoLicense" | No valid license is available for sensitivity labeling. |