From 14a0c620a94a8855df24d54f005963650afd5315 Mon Sep 17 00:00:00 2001 From: JASWINDER BHAMRA Date: Tue, 8 Aug 2023 13:35:22 +0530 Subject: [PATCH] DGRAPHCORE-355: Allow data deletion for non-internal predicates --- query/mutation.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/query/mutation.go b/query/mutation.go index 274870c1e2f..df586c58b61 100644 --- a/query/mutation.go +++ b/query/mutation.go @@ -286,6 +286,9 @@ func checkIfDeletingAclOperation(ctx context.Context, edges []*pb.DirectedEdge) isDeleteAclOperation := false for _, edge := range edges { + if !x.IsReservedPredicate(edge.Attr) { + continue + } // Disallow deleting of guardians group if edge.Entity == guardianUid && edge.Op == pb.DirectedEdge_DEL { isDeleteAclOperation = true @@ -298,7 +301,7 @@ func checkIfDeletingAclOperation(ctx context.Context, edges []*pb.DirectedEdge) } } if isDeleteAclOperation { - return errors.Errorf("Properties of guardians group and groot user cannot be deleted.") + return errors.Errorf("Reserved properties of guardians group and groot user cannot be deleted.") } return nil }