list customSecurityAttributeDefinitions

名前空間: microsoft.graph

重要

Microsoft Graph のバージョンの /beta API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 API が v1.0 で使用できるかどうかを確認するには、 バージョン セレクターを使用します。

customSecurityAttributeDefinition オブジェクトとそのプロパティの一覧を取得します。

アクセス許可

この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。

アクセス許可の種類 アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント) CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All
委任 (個人用 Microsoft アカウント) サポートされていません。
アプリケーション CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All

サインインしているユーザーには、次のいずれかのディレクトリ ロールを割り当てる 必要があります

  • 属性定義リーダー
  • 属性の割り当て管理者
  • 属性定義管理者

既定では、グローバル管理者と他の管理者ロールには、カスタム セキュリティ属性の読み取り、定義、または割り当て権限はありません。

HTTP 要求

GET /directory/customSecurityAttributeDefinitions

オプションのクエリ パラメーター

このメソッドは、$select応答のカスタマイズ$top``$expandに役立つ $filter 、および (eq) OData クエリ パラメーターをサポートします。 一般的な情報については、「OData クエリ パラメーター」を参照してください。

ナビゲーション allowedValues プロパティは既定では返または展開されません。クエリで指定する必要 $expand があります。 たとえば、/directory/customSecurityAttributeDefinitions?$expand=allowedValues などです。

要求ヘッダー

名前 説明
Authorization ベアラー {token}。必須。

要求本文

このメソッドには、要求本文を指定しません。

応答

成功した場合、このメソッドは 200 OK 応答コードと、応答本文の customSecurityAttributeDefinition オブジェクトのコレクションを返します。

例 1: すべてのカスタム セキュリティ属性を取得する

次の例では、テナント内のすべてのカスタム セキュリティ属性定義を取得します。

要求

GET https://graph.microsoft.com/beta/directory/customSecurityAttributeDefinitions

応答

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/customSecurityAttributeDefinitions",
    "value": [
        {
            "attributeSet": "Engineering",
            "description": "Active projects for user",
            "id": "Engineering_Project",
            "isCollection": true,
            "isSearchable": true,
            "name": "Project",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": true
        },
        {
            "attributeSet": "Engineering",
            "description": "Target completion date",
            "id": "Engineering_ProjectDate",
            "isCollection": false,
            "isSearchable": true,
            "name": "ProjectDate",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": false
        },
        {
            "attributeSet": "Operations",
            "description": "Target completion date",
            "id": "Operations_Level",
            "isCollection": false,
            "isSearchable": true,
            "name": "Deployment level",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": true
        }
    ]
}

例 2: 名前に基づいてカスタム セキュリティ属性をフィルター処理する

次の使用例は、名前が付き、アクティブなカスタム セキュリティ Project 属性定義を取得します。

要求

GET https://graph.microsoft.com/beta/directory/customSecurityAttributeDefinitions?$filter=name+eq+'Project'%20and%20status+eq+'Available'

応答

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/customSecurityAttributeDefinitions",
    "value": [
        {
            "attributeSet": "Engineering",
            "description": "Active projects for user",
            "id": "Engineering_Project",
            "isCollection": true,
            "isSearchable": true,
            "name": "Project",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": true
        },
        {
            "attributeSet": "Operations",
            "description": "Approved projects",
            "id": "Operations_Project",
            "isCollection": true,
            "isSearchable": true,
            "name": "Project",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": true
        }
    ]
}

例 3: 属性セットに基づいてカスタム セキュリティ属性をフィルター処理する

次の使用例は、属性セット内 Engineering でアクティブで、String 型のカスタム セキュリティ属性定義を取得します。

要求

GET https://graph.microsoft.com/beta/directory/customSecurityAttributeDefinitions?$filter=attributeSet+eq+'Engineering'%20and%20status+eq+'Available'%20and%20type+eq+'String'

応答

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/customSecurityAttributeDefinitions",
    "value": [
        {
            "attributeSet": "Engineering",
            "description": "Active projects for user",
            "id": "Engineering_Project",
            "isCollection": true,
            "isSearchable": true,
            "name": "Project",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": true
        },
        {
            "attributeSet": "Engineering",
            "description": "Target completion date (YYYY/MM/DD)",
            "id": "Engineering_ProjectDate",
            "isCollection": false,
            "isSearchable": true,
            "name": "ProjectDate",
            "status": "Available",
            "type": "String",
            "usePreDefinedValuesOnly": false
        }
    ]
}