---
title: "canDeleteRecord(forManagedObjectWith:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nspersistentcloudkitcontainer/candeleterecord(formanagedobjectwith:)"
---

# canDeleteRecord(forManagedObjectWith:)

Returns a Boolean value that indicates whether the user can delete the managed object’s underlying CloudKit record.

## Declaration

```swift
func canDeleteRecord(forManagedObjectWith objectID: NSManagedObjectID) -> Bool
```

## Parameters

- `objectID`: The ID of the managed object.

## Return Value

Return Value true if the user can delete the CloudKit record; otherwise, false.

## Discussion

Discussion This method returns true if canModifyManagedObjects(in:) returns true and any of the following conditions are true: objectID is a temporary object identifier. The persistent store that contains the managed object isn’t using CloudKit. The persistent store manages the user’s private database. The persistent store manages the public database, and the user owns the underlying record or Core Data has yet to save the managed object to iCloud. The persistent store manages the shared database, and the user has the necessary permissions to delete the managed object’s underlying record. For more information, see CKShare.ParticipantPermission.

## See Also

### Checking Permissions

- [canUpdateRecord(forManagedObjectWith:)](coredata/nspersistentcloudkitcontainer/canupdaterecord(formanagedobjectwith:).md)
- [canModifyManagedObjects(in:)](coredata/nspersistentcloudkitcontainer/canmodifymanagedobjects(in:).md)
