Skip to content

Commit

Permalink
DGRAPHCORE-355: Allow data deletion for non-internal predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhamra1 committed Aug 8, 2023
1 parent d8d661f commit 14a0c62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion query/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

0 comments on commit 14a0c62

Please sign in to comment.