L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins)
Clé de l’entité. Elle est en lecture seule et générée automatiquement. Hérité de roleAssignment
displayName
String
Nom convivial de l’attribution de rôle. Hérité de roleAssignment
description
String
Description de l’attribution de rôle. Hérité de roleAssignment
resourceScopes
String collection
Liste des ID des groupes de sécurité de membre d’étendue de rôle. Voici les ID d’Azure Active Directory. Hérité de roleAssignment
membres
String collection
Liste des ID de groupes de sécurité de membre de rôle. Voici les ID d’Azure Active Directory.
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 200 OK et un objet deviceAndAppManagementRoleAssignment mis à jour dans le corps de la réponse.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceAndAppManagementRoleAssignment
{
OdataType = "#microsoft.graph.deviceAndAppManagementRoleAssignment",
DisplayName = "Display Name value",
Description = "Description value",
ResourceScopes = new List<string>
{
"Resource Scopes value",
},
Members = new List<string>
{
"Members value",
},
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.RoleAssignments["{deviceAndAppManagementRoleAssignment-id}"].PatchAsync(requestBody);
// 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"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewDeviceAndAppManagementRoleAssignment()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
resourceScopes := []string {
"Resource Scopes value",
}
requestBody.SetResourceScopes(resourceScopes)
members := []string {
"Members value",
}
requestBody.SetMembers(members)
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=go
roleAssignments, err := graphClient.DeviceManagement().RoleAssignments().ByDeviceAndAppManagementRoleAssignmentId("deviceAndAppManagementRoleAssignment-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceAndAppManagementRoleAssignment deviceAndAppManagementRoleAssignment = new DeviceAndAppManagementRoleAssignment();
deviceAndAppManagementRoleAssignment.setOdataType("#microsoft.graph.deviceAndAppManagementRoleAssignment");
deviceAndAppManagementRoleAssignment.setDisplayName("Display Name value");
deviceAndAppManagementRoleAssignment.setDescription("Description value");
LinkedList<String> resourceScopes = new LinkedList<String>();
resourceScopes.add("Resource Scopes value");
deviceAndAppManagementRoleAssignment.setResourceScopes(resourceScopes);
LinkedList<String> members = new LinkedList<String>();
members.add("Members value");
deviceAndAppManagementRoleAssignment.setMembers(members);
DeviceAndAppManagementRoleAssignment result = graphClient.deviceManagement().roleAssignments().byDeviceAndAppManagementRoleAssignmentId("{deviceAndAppManagementRoleAssignment-id}").patch(deviceAndAppManagementRoleAssignment);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_and_app_management_role_assignment import DeviceAndAppManagementRoleAssignment
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceAndAppManagementRoleAssignment(
odata_type = "#microsoft.graph.deviceAndAppManagementRoleAssignment",
display_name = "Display Name value",
description = "Description value",
resource_scopes = [
"Resource Scopes value",
],
members = [
"Members value",
],
)
result = await graph_client.device_management.role_assignments.by_device_and_app_management_role_assignment_id('deviceAndAppManagementRoleAssignment-id').patch(request_body)
Voici un exemple de réponse. Remarque : l’objet de réponse illustré ici peut être tronqué à des fins de concision. Toutes les propriétés sont renvoyées à partir d’un appel réel.