PowerPoint.LabelingCapability enum

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

指示标记功能。

注解

API 集:PowerPointApi BETA (仅预览版)

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/preview-apis/manage-sensitivity-labels.yaml

await PowerPoint.run(async (context) => {
  // Check whether sensitivity labeling is available for the current user.
  const labelCatalog: PowerPoint.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 PowerPoint.LabelingCapability.labelingEnabled:
      console.log("Sensitivity labeling is enabled.");
      break;
    case PowerPoint.LabelingCapability.labelingDisabled:
      console.log("Sensitivity labeling is disabled.");
      break;
    case PowerPoint.LabelingCapability.labelingPolicyNotFound:
      console.log("No sensitivity labeling policy was found.");
      break;
    case PowerPoint.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"

表示主机支持的基于属性 (ABAC) 的访问控制。 随 一起 labelingEnabled返回时,加载项可能使用特定于 ABAC 的 API,例如 SensitivityLabelsCatalog.getAttributes。

labelingDisabled = "LabelingDisabled"

表示标签被禁用。

labelingEnabled = "LabelingEnabled"

表示标签正在启用。

labelingPolicyNotFound = "LabelingPolicyNotFound"

表示找不到标签策略。

noLicense = "NoLicense"

表示没有有效的许可证。