Share via


メッセージまたは予定の秘密度ラベルを作成モードで管理する

職場でのコラボレーションは、organization内で行われるだけでなく、外部のパートナーにも広がります。 organizationのネットワークを超えて情報を共有する場合は、データの損失を防ぎ、コンプライアンス ポリシーを適用するための対策を確立することが重要です。 Microsoft Purview 情報保護は、機密情報を分類して保護するためのソリューションを実装するのに役立ちます。 Outlook での秘密度ラベルの使用は、データを保護するために構成できる機能です。

Office JavaScript API を使用して、Outlook アドイン プロジェクトに秘密度ラベル ソリューションを実装し、次のシナリオをサポートできます。

  • ユーザーが作業に集中できるように、構成中に特定のメッセージや予定に秘密度ラベルを自動的に適用します。
  • 特定の秘密度ラベルがメッセージまたは予定に適用されている場合 、ユーザーがメッセージに外部受信者を追加できないようにするなど、追加のアクションを制限します。
  • ビジネス ポリシーと法的ポリシーに準拠するために、秘密度ラベルに基づいてヘッダーまたはフッターをメッセージまたは予定に追加します。

注:

秘密度ラベル機能のサポートは 、要件セット 1.13 で導入されました。 この機能のクライアント サポートについては、「 サポートされているクライアントとプラットフォーム」を参照してください。

前提条件

アドインに秘密度ラベル機能を実装するには、Microsoft 365 E5 サブスクリプションが必要です。 Microsoft 365 開発者プログラムを通じてMicrosoft 365 E5開発者サブスクリプションを受ける資格がある場合があります。詳細については、FAQ を参照してください。 または、 1 か月間の無料試用版にサインアップ するか、 Microsoft 365 プランを購入することもできます。

サポートされているクライアントとプラットフォーム

次の表に、Outlook アドインでの秘密度ラベル機能の使用をサポートするクライアントとサーバーの組み合わせを示します。除外された組み合わせはサポートされていません。

クライアント Exchange Online
Web ブラウザー (モダン UI)

新しい Outlook on Windows (プレビュー)
サポート
Windows (クラシック)
バージョン 2304 (ビルド 16327.20248) 以降
サポート
Mac
バージョン 16.77.816.0 以降
サポート
Android 該当なし
iOS 該当なし

マニフェストを構成する

Outlook アドイン プロジェクトで秘密度機能を使用するには、アドインのマニフェストで アイテムの読み取り/書き込み アクセス許可を構成する必要があります。

  • Microsoft 365 の統合マニフェスト: "authorization.permissions.resourceSpecific" 配列で、オブジェクトの "name" プロパティを "MailboxItem.ReadWrite.User" に設定します。
  • XML マニフェスト: Permissions> 要素を<ReadWriteItem に設定します。

アドインがイベントを検出して処理する OnSensitivityLabelChanged 場合、イベント ベースのアクティブ化機能を有効にするには、追加のマニフェスト構成が必要です。 詳細については、「 OnSensitivityLabelChanged イベントを使用して秘密度ラベルの変更を検出する」を参照してください。

秘密度ラベルのカタログの状態を確認する

秘密度ラベルとポリシーは、Microsoft Purview コンプライアンス ポータルを通じてorganizationの管理者によって構成されます。 テナントで秘密度ラベルを構成する方法のガイダンスについては、「秘密度ラベルとそのポリシーをCreateして構成する」を参照してください。

メッセージまたは予定の秘密度ラベルを取得または設定する前に、まず、アドインがインストールされているメールボックスで秘密度ラベルのカタログが有効になっていることを確認する必要があります。 秘密度ラベルのカタログの状態をチェックするには、作成モードで context.sensitivityLabelsCatalog.getIsEnabledAsync を呼び出します。

// Check whether the catalog of sensitivity labels is enabled.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
        console.log(asyncResult.value);
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

使用可能な秘密度ラベルを特定する

メッセージまたは予定で使用できる秘密度ラベルを作成モードで決定する場合は、 context.sensitivityLabelsCatalog.getAsync を使用します。 使用可能なラベルは、次の詳細を提供する SensitivityLabelDetails オブジェクトの形式で返されます。

  • ラベルの名前。
  • ラベルの一意識別子 (GUID)。
  • ラベルの説明。
  • ラベルに割り当てられた色。
  • 構成された サブラベル (存在する場合)。

次の例は、カタログで使用できる秘密度ラベルを識別する方法を示しています。

// It's recommended to check the status of the catalog of sensitivity labels before
// calling other sensitivity label methods.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
        // Identify available sensitivity labels in the catalog.
        Office.context.sensitivityLabelsCatalog.getAsync((asyncResult) => {
            if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                const catalog = asyncResult.value;
                console.log("Sensitivity Labels Catalog:");
                catalog.forEach((sensitivityLabel) => {
                    console.log(`Name: ${sensitivityLabel.name}`);
                    console.log(`ID: ${sensitivityLabel.id}`);
                    console.log(`Tooltip: ${sensitivityLabel.tooltip}`);
                    console.log(`Color: ${sensitivityLabel.color}`);
                    console.log(`Sublabels: ${JSON.stringify(sensitivityLabel.children)}`);
                });
            } else {
                console.log("Action failed with error: " + asyncResult.error.message);
            }
        });
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

メッセージまたは予定の秘密度ラベルを取得する

作成モードでメッセージまたは予定に現在適用されている秘密度ラベルを取得するには、次の例に示すように item.sensitivityLabel.getAsync を呼び出します。 これにより、秘密度ラベルの GUID が返されます。

// It's recommended to check the status of the catalog of sensitivity labels before
// calling other sensitivity label methods.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
        // Get the current sensitivity label of a message or appointment.
        Office.context.mailbox.item.sensitivityLabel.getAsync((asyncResult) => {
            if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                console.log(asyncResult.value);
            } else {
                console.log("Action failed with error: " + asyncResult.error.message);
            }
        });
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

メッセージまたは予定に秘密度ラベルを設定する

メッセージまたは予定に設定できる秘密度ラベルは、作成モードでは 1 つだけです。 ラベルを設定する前に、 context.sensitivityLabelsCatalog.getAsync を呼び出します。 これにより、適用するラベルを使用できるようになります。 また、ラベルの GUID を識別するのにも役立ちます。この GUID は、メール アイテムにラベルを適用する必要があります。 ラベルの可用性を確認したら、次の例に示すように、その GUID を パラメーターとして item.sensitivityLabel.setAsync に渡します。

// It's recommended to check the status of the catalog of sensitivity labels before
// calling other sensitivity label methods.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
        // Identify available sensitivity labels in the catalog.
        Office.context.sensitivityLabelsCatalog.getAsync((asyncResult) => {
            if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                const catalog = asyncResult.value;
                if (catalog.length > 0) {
                    // Get the GUID of the sensitivity label.
                    var id = catalog[0].id;
                    // Set the mail item's sensitivity label using the label's GUID.
                    Office.context.mailbox.item.sensitivityLabel.setAsync(id, (asyncResult) => {
                        if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                            console.log(asyncResult.status);
                        } else {
                            console.log("Action failed with error: " + asyncResult.error.message);
                        }
                    });
                } else {
                    console.log("Catalog list is empty");
                }
            } else {
                console.log("Action failed with error: " + asyncResult.error.message);
            }
        });
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

GUID を使用して秘密度ラベルを設定する代わりに、次の例に示すように、カタログ呼び出しから取得した SensitivityLabelDetails オブジェクトを渡すことができます。

// It's recommended to check the status of the catalog of sensitivity labels before
// calling other sensitivity label methods.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
        // Identify available sensitivity labels in the catalog.
        Office.context.sensitivityLabelsCatalog.getAsync((asyncResult) => {
            if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                const catalog = asyncResult.value;
                if (catalog.length > 0) {
                    // Set the mail item's sensitivity label using the SensitivityLabelDetails object.
                    Office.context.mailbox.item.sensitivityLabel.setAsync(catalog[0], (asyncResult) => {
                        if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                            console.log(asyncResult.status);
                        } else {
                            console.log("Action failed with error: " + asyncResult.error.message);
                        }
                    });
                } else {
                    console.log("Catalog list is empty");
                }
            } else {
                console.log("Action failed with error: " + asyncResult.error.message);
            }
        });
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

OnSensitivityLabelChanged イベントを使用して秘密度ラベルの変更を検出する

イベントを使用してデータを保護するための追加の対策を OnSensitivityLabelChanged 講じてみましょう。 このイベントにより、アドインは、メッセージまたは予定の秘密度ラベルの変更に応答してタスクを完了できます。 たとえば、特定の添付ファイルが含まれている場合、ユーザーがメール アイテムの秘密度ラベルをダウングレードできないようにすることができます。

イベントは OnSensitivityLabelChanged 、イベント ベースのアクティブ化機能を使用して使用できます。 このイベントを使用するイベント ベースのアドインを構成、デバッグ、展開する方法については、「イベントベースの アクティブ化のために Outlook アドインを構成する」を参照してください。

関連項目