Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
Tipo de permissão
Permissões com menos privilégios
Permissões com privilégios superiores
Delegado (conta corporativa ou de estudante)
EntitlementManagement.Read.All
EntitlementManagement.ReadWrite.All
Delegado (conta pessoal da Microsoft)
Sem suporte.
Sem suporte.
Application
EntitlementManagement.Read.All
EntitlementManagement.ReadWrite.All
Dica
Em cenários delegados com contas escolares ou profissionais, o utilizador com sessão iniciada também tem de ter uma função de administrador com permissões de função suportadas através de uma das seguintes opções:
Em cenários apenas de aplicações, a aplicação de chamadas pode ser atribuída a uma das funções suportadas anteriores em vez da permissão da aplicação EntitlementManagement.Read.All . A função leitor de catálogo tem menos privilégios do que a permissão da aplicação EntitlementManagement.Read.All .
GET /identityGovernance/entitlementManagement/catalogs/{id}/resources
Parâmetros de consulta opcionais
Este método dá suporte a Parâmetros de consulta do OData para ajudar a personalizar a resposta. Por exemplo, para obter os ambientes e os âmbitos de recursos do pacote de acesso para cada recurso, inclua $expand=scopes,environment na consulta. Para obter as funções disponíveis de um recurso e o respetivo âmbito, inclua $expand=roles,scopes. Para obter informações gerais, acesse Parâmetros de consulta OData.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/{id}/resources?$expand=scopes
// 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.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].Resources.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "scopes" };
});
// 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"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
//other-imports
)
requestParameters := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetQueryParameters{
Expand: [] string {"scopes"},
}
configuration := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
resources, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").Resources().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").resources().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"scopes"};
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.item.resources.resources_request_builder import ResourcesRequestBuilder
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 = ResourcesRequestBuilder.ResourcesRequestBuilderGetQueryParameters(
expand = ["scopes"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').resources.get(request_configuration = request_configuration)
Exemplo 2: Obter as funções e âmbitos de um único recurso num catálogo
Solicitação
Segue-se um exemplo do pedido, que utiliza $expand para devolver as funções e os âmbitos de um único recurso. O recurso já tem de estar presente no catálogo.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/{catalogId}/resources?$expand=roles,scopes&$filter=id eq '{resourceId}'
// 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.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].Resources.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "roles","scopes" };
requestConfiguration.QueryParameters.Filter = "id eq '{resourceId}'";
});
// 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"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
//other-imports
)
requestFilter := "id eq '{resourceId}'"
requestParameters := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetQueryParameters{
Expand: [] string {"roles","scopes"},
Filter: &requestFilter,
}
configuration := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
resources, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").Resources().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").resources().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"roles", "scopes"};
requestConfiguration.queryParameters.filter = "id eq '{resourceId}'";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.item.resources.resources_request_builder import ResourcesRequestBuilder
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 = ResourcesRequestBuilder.ResourcesRequestBuilderGetQueryParameters(
expand = ["roles","scopes"],
filter = "id eq '{resourceId}'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').resources.get(request_configuration = request_configuration)
Exemplo 3: Obter as funções e âmbitos de um único recurso num catálogo por ID de origem
Solicitação
Segue-se um exemplo do pedido, que utiliza $expand para devolver as funções e os âmbitos de um único recurso. O filtro utiliza a originId propriedade accessPackageResource para fazer referência ao identificador no sistema de origem. Se o recurso no catálogo for baseado num grupo, este valor será o id desse grupo.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/{catalogId}/resources?$expand=roles,scopes&$filter=originId eq '0282e19d-bf41-435d-92a4-99bab93af305'
// 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.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].Resources.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "roles","scopes" };
requestConfiguration.QueryParameters.Filter = "originId eq '0282e19d-bf41-435d-92a4-99bab93af305'";
});
// 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"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
//other-imports
)
requestFilter := "originId eq '0282e19d-bf41-435d-92a4-99bab93af305'"
requestParameters := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetQueryParameters{
Expand: [] string {"roles","scopes"},
Filter: &requestFilter,
}
configuration := &graphidentitygovernance.EntitlementManagementCatalogsItemResourcesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
resources, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").Resources().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").resources().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"roles", "scopes"};
requestConfiguration.queryParameters.filter = "originId eq '0282e19d-bf41-435d-92a4-99bab93af305'";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.item.resources.resources_request_builder import ResourcesRequestBuilder
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 = ResourcesRequestBuilder.ResourcesRequestBuilderGetQueryParameters(
expand = ["roles","scopes"],
filter = "originId eq '0282e19d-bf41-435d-92a4-99bab93af305'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').resources.get(request_configuration = request_configuration)