PowerPoint.SensitivityLabelDetails class
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
PowerPoint で使用可能な秘密度ラベルのプロパティを表します。
- Extends
注釈
API セット: PowerPointApi ベータ版 (プレビューのみ)
使用元
- PowerPoint.SensitivityLabel: getCurrentOrNullObject
- PowerPoint.SensitivityLabelDetailsCollection: getItem、 getItemAt、 getItemOrNullObject、 items
例
// 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}`
);
});
プロパティ
| abac |
この秘密度ラベルに現在適用されている属性ベースのアクセス制御 (ABAC) 属性値を取得します。 ABAC 属性が適用されていない場合、またはこのラベルが ABAC 対応でない場合は、空の配列を返します。 |
| children | 秘密度ラベルのサブラベルを取得します。 |
| color | 秘密度ラベルの色を取得します。 |
| context | オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。 |
| id | 秘密度ラベルの一意の ID を取得します。 |
| is |
このラベルを適用するために ABAC 属性の選択が必要かどうかを取得します。
|
| is |
このラベルが属性ベースのアクセス制御 (ABAC) が有効になっているかどうかを取得します。 ホストのラベル付け機能に |
| is |
ラベルが有効かどうかを示す値を取得します。 |
| name | 秘密度ラベルの名前を取得します。 |
| order | 秘密度ラベルの優先度を取得し、最も低い優先度は 0 です。 |
| protection |
このラベルによって提供される保護の種類を示す値を取得します。 |
| site |
秘密度ラベルが属するテナントの一意の ID を取得します。 |
| tooltip | 秘密度ラベルの説明を取得します。 |
メソッド
| load(options) | オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
| load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
| load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
| toJSON() | API オブジェクトが |
プロパティの詳細
abacAttributeValues
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
この秘密度ラベルに現在適用されている属性ベースのアクセス制御 (ABAC) 属性値を取得します。 ABAC 属性が適用されていない場合、またはこのラベルが ABAC 対応でない場合は、空の配列を返します。
readonly abacAttributeValues: PowerPoint.SensitivityLabelAbacAttributeValue[];
プロパティ値
注釈
children
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルのサブラベルを取得します。
readonly children: PowerPoint.SensitivityLabelDetailsCollection;
プロパティ値
注釈
color
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルの色を取得します。
readonly color: string;
プロパティ値
string
注釈
context
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。
context: RequestContext;
プロパティ値
id
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルの一意の ID を取得します。
readonly id: string;
プロパティ値
string
注釈
isAbacAttributesRequired
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
このラベルを適用するために ABAC 属性の選択が必要かどうかを取得します。
true
の場合、呼び出し元はラベルを適用するときに属性値を指定する必要があります。それ以外の場合、更新結果のstatusは SensitivityLabelUpdateStatus.abacAttributesRequired になります。
readonly isAbacAttributesRequired: boolean;
プロパティ値
boolean
注釈
isAbacEnabled
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
このラベルが属性ベースのアクセス制御 (ABAC) が有効になっているかどうかを取得します。 ホストのラベル付け機能に attributeBasedAccessControlEnabled が含まれていない場合は false を返します。
readonly isAbacEnabled: boolean;
プロパティ値
boolean
注釈
isEnabled
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
ラベルが有効かどうかを示す値を取得します。
readonly isEnabled: boolean;
プロパティ値
boolean
注釈
name
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルの名前を取得します。
readonly name: string;
プロパティ値
string
注釈
order
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルの優先度を取得し、最も低い優先度は 0 です。
readonly order: number;
プロパティ値
number
注釈
protectionType
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
このラベルによって提供される保護の種類を示す値を取得します。
readonly protectionType: PowerPoint.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined";
プロパティ値
PowerPoint.SensitivityLabelProtectionType | "NoProtection" | "AdminDefined" | "UserDefined"
注釈
siteId
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルが属するテナントの一意の ID を取得します。
readonly siteId: string;
プロパティ値
string
注釈
tooltip
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
秘密度ラベルの説明を取得します。
readonly tooltip: string;
プロパティ値
string
注釈
メソッドの詳細
load(options)
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。
load(options?: PowerPoint.Interfaces.SensitivityLabelDetailsLoadOptions): PowerPoint.SensitivityLabelDetails;
パラメーター
読み込むオブジェクトのプロパティのオプションを指定します。
戻り値
load(propertyNames)
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。
load(propertyNames?: string | string[]): PowerPoint.SensitivityLabelDetails;
パラメーター
- propertyNames
-
string | string[]
読み込むプロパティを指定するコンマ区切りの文字列または文字列の配列。
戻り値
load(propertyNamesAndPaths)
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): PowerPoint.SensitivityLabelDetails;
パラメーター
- propertyNamesAndPaths
-
{ select?: string; expand?: string; }
propertyNamesAndPaths.select は読み込むプロパティを指定するコンマ区切りの文字列であり、 propertyNamesAndPaths.expand は読み込むナビゲーションのプロパティを指定するコンマ区切りの文字列です。
戻り値
toJSON()
注意
この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。
API オブジェクトが JSON.stringify() に渡されるときに、より有用な出力を提供するために、JavaScript toJSON() メソッドをオーバーライドします。 (次に、JSON.stringify渡されたオブジェクトの toJSON メソッドを呼び出します)。元の PowerPoint.SensitivityLabelDetails オブジェクトが API オブジェクトであるのに対し、 toJSON メソッドは、元のオブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト ( PowerPoint.Interfaces.SensitivityLabelDetailsData と型指定) を返します。
toJSON(): PowerPoint.Interfaces.SensitivityLabelDetailsData;