In general, only teachers in the class can remove a resource. However, teachers cannot remove resources marked as "distributeToStudents", after the assignment has been published to students.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
var graphClient = new GraphServiceClient(requestAdapter);
await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Resources["{educationAssignmentResource-id}"].DeleteAsync();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
graphClient.Education().ClassesById("educationClass-id").AssignmentsById("educationAssignment-id").ResourcesById("educationAssignmentResource-id").Delete(context.Background(), nil)
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$graphServiceClient->education()->classesById('educationClass-id')->assignmentsById('educationAssignment-id')->resourcesById('educationAssignmentResource-id')->delete();