PowerPoint.SensitivityLabelAbacAttributeValue interface
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルに適用できる属性ベースのアクセス制御 (ABAC) 属性の単一の選択可能な値を表します。
注釈
API セット: PowerPointApi ベータ版 (プレビューのみ)
使用元
- PowerPoint.SensitivityLabelAbacAttribute: values
- PowerPoint.SensitivityLabelDetails: abacAttributeValues
例
// 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) => {
// Get the sensitivity label currently applied to the presentation.
const presentation: PowerPoint.Presentation = context.presentation;
const presentationLabel: PowerPoint.SensitivityLabel = presentation.sensitivityLabel;
const currentLabel: PowerPoint.SensitivityLabelDetails = presentationLabel.getCurrentOrNullObject();
// Load the properties of the label currently applied to the presentation.
currentLabel.load(
"color,id,isAbacAttributesRequired,isAbacEnabled,isEnabled,name,order,protectionType,siteId,tooltip"
);
await context.sync();
if (currentLabel.isNullObject) {
console.log("The presentation doesn't have a sensitivity label.");
return;
}
// Get ABAC values when enabled for the label.
let abacAttributeValues: PowerPoint.SensitivityLabelAbacAttributeValue[] = [];
if (currentLabel.isAbacEnabled) {
currentLabel.load("abacAttributeValues");
await context.sync();
abacAttributeValues = currentLabel.abacAttributeValues;
}
// Display the loaded properties of the current label.
const attributeValues = abacAttributeValues.length
? abacAttributeValues
.map(
(attributeValue: PowerPoint.SensitivityLabelAbacAttributeValue) =>
`${attributeValue.displayName} (ID: ${attributeValue.id}, order: ${attributeValue.displayOrder}, active: ${attributeValue.isActive ? "Yes" : "No"})`
)
.join(", ")
: "None";
let protectionDescription: string;
switch (currentLabel.protectionType) {
case PowerPoint.SensitivityLabelProtectionType.adminDefined:
protectionDescription = "Defined by an administrator";
break;
case PowerPoint.SensitivityLabelProtectionType.userDefined:
protectionDescription = "Defined by the user";
break;
case PowerPoint.SensitivityLabelProtectionType.noProtection:
protectionDescription = "No protection";
break;
default:
protectionDescription = `Unknown (${currentLabel.protectionType})`;
break;
}
console.log(
`Current presentation sensitivity label:\n\n${currentLabel.name}\n` +
` ID: ${currentLabel.id}\n` +
` Site ID: ${currentLabel.siteId}\n` +
` Tooltip: ${currentLabel.tooltip}\n` +
` Color: ${currentLabel.color}\n` +
` Enabled: ${currentLabel.isEnabled ? "Yes" : "No"}\n` +
` Display order: ${currentLabel.order}\n` +
` ABAC enabled: ${currentLabel.isAbacEnabled ? "Yes" : "No"}\n` +
` ABAC attributes required: ${currentLabel.isAbacAttributesRequired ? "Yes" : "No"}\n` +
` ABAC attribute values: ${attributeValues}\n` +
` Protection type: ${protectionDescription}`
);
});
プロパティ
| display |
ABAC 属性値の表示名を取得します。 アドインは、ローカライズされたユーザー向け UI を表示する役割を担います。 |
| display |
ユーザーに表示されたときに、この ABAC 値の属性内の推奨順序を取得します。 |
| id | ABAC 属性値の一意識別子を取得します。 この識別子は、ラベルの ABAC 属性の選択を適用または更新するときに使用されます。 |
| is |
この ABAC 属性値がアクティブかどうかを取得します。
|
プロパティの詳細
displayName
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
ABAC 属性値の表示名を取得します。 アドインは、ローカライズされたユーザー向け UI を表示する役割を担います。
displayName: string;
プロパティ値
string
注釈
displayOrder
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
ユーザーに表示されたときに、この ABAC 値の属性内の推奨順序を取得します。
displayOrder: number;
プロパティ値
number
注釈
id
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
ABAC 属性値の一意識別子を取得します。 この識別子は、ラベルの ABAC 属性の選択を適用または更新するときに使用されます。
id: string;
プロパティ値
string
注釈
isActive
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
この ABAC 属性値がアクティブかどうかを取得します。
true 値がアクティブな場合。それ以外の場合は、 false。
isActive: boolean;
プロパティ値
boolean