Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
Тип разрешения
Разрешения с наименьшими привилегиями
Более высокие привилегированные разрешения
Делегированные (рабочая или учебная учетная запись)
CustomSecAttributeDefinition.Read.All
CustomSecAttributeDefinition.ReadWrite.All
Делегированные (личная учетная запись Майкрософт)
Не поддерживается.
Не поддерживается.
Приложение
CustomSecAttributeDefinition.Read.All
CustomSecAttributeDefinition.ReadWrite.All
Пользователю, выполнившего вход, также должна быть назначена одна из следующих ролей каталога:
Средство чтения определений атрибутов
Администратор назначения атрибутов
Администратор определения атрибутов
По умолчанию глобальный администратор и другие роли администратора не имеют разрешений на чтение, определение или назначение настраиваемых атрибутов безопасности.
HTTP-запрос
GET /directory/customSecurityAttributeDefinitions
Необязательные параметры запросов
Этот метод поддерживает $selectпараметры запроса OData , $top, $expand, и $filter (eq) для настройки ответа. Общие сведения см. в статье Параметры запроса OData.
Свойство навигации allowedValues не возвращается или расширяется по умолчанию и должно быть указано в запросе $expand . Например, /directory/customSecurityAttributeDefinitions?$expand=allowedValues.
GET https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.CustomSecurityAttributeDefinitions.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customSecurityAttributeDefinitions, err := graphClient.Directory().CustomSecurityAttributeDefinitions().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CustomSecurityAttributeDefinitionCollectionResponse result = graphClient.directory().customSecurityAttributeDefinitions().get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.directory.custom_security_attribute_definitions.get()
GET https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions?$filter=name+eq+'Project'%20and%20status+eq+'Available'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.CustomSecurityAttributeDefinitions.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "name eq 'Project' and status eq 'Available'";
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphdirectory "github.com/microsoftgraph/msgraph-sdk-go/directory"
//other-imports
)
requestFilter := "name eq 'Project' and status eq 'Available'"
requestParameters := &graphdirectory.DirectoryCustomSecurityAttributeDefinitionsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphdirectory.DirectoryCustomSecurityAttributeDefinitionsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customSecurityAttributeDefinitions, err := graphClient.Directory().CustomSecurityAttributeDefinitions().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CustomSecurityAttributeDefinitionCollectionResponse result = graphClient.directory().customSecurityAttributeDefinitions().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "name eq 'Project' and status eq 'Available'";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.directory.custom_security_attribute_definitions.custom_security_attribute_definitions_request_builder import CustomSecurityAttributeDefinitionsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = CustomSecurityAttributeDefinitionsRequestBuilder.CustomSecurityAttributeDefinitionsRequestBuilderGetQueryParameters(
filter = "name eq 'Project' and status eq 'Available'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.directory.custom_security_attribute_definitions.get(request_configuration = request_configuration)
Пример 3. Фильтрация настраиваемых атрибутов безопасности на основе набора атрибутов
В следующем примере извлекаются определения настраиваемых атрибутов безопасности, которые находятся в наборе Engineering атрибутов, активны и имеют тип String.
GET https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions?$filter=attributeSet+eq+'Engineering'%20and%20status+eq+'Available'%20and%20type+eq+'String'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.CustomSecurityAttributeDefinitions.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'";
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphdirectory "github.com/microsoftgraph/msgraph-sdk-go/directory"
//other-imports
)
requestFilter := "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'"
requestParameters := &graphdirectory.DirectoryCustomSecurityAttributeDefinitionsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphdirectory.DirectoryCustomSecurityAttributeDefinitionsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customSecurityAttributeDefinitions, err := graphClient.Directory().CustomSecurityAttributeDefinitions().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CustomSecurityAttributeDefinitionCollectionResponse result = graphClient.directory().customSecurityAttributeDefinitions().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'";
});
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Directory\CustomSecurityAttributeDefinitions\CustomSecurityAttributeDefinitionsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CustomSecurityAttributeDefinitionsRequestBuilderGetRequestConfiguration();
$queryParameters = CustomSecurityAttributeDefinitionsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->directory()->customSecurityAttributeDefinitions()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDirectoryCustomSecurityAttributeDefinition -Filter "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.directory.custom_security_attribute_definitions.custom_security_attribute_definitions_request_builder import CustomSecurityAttributeDefinitionsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = CustomSecurityAttributeDefinitionsRequestBuilder.CustomSecurityAttributeDefinitionsRequestBuilderGetQueryParameters(
filter = "attributeSet eq 'Engineering' and status eq 'Available' and type eq 'String'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.directory.custom_security_attribute_definitions.get(request_configuration = request_configuration)