I created an app in CloudKit last year and works fine.
Now I'm creating a new app but I've a very stupid problem (maybe is the covid in my mind), in permission I can't flag the "Create" permission, so when I create a record the console prints:
Optional("Error saving record <CKRecordID: 0x100dc1540; recordName=idnumber0000001, zoneID=_defaultZone:__defaultOwner__> to server: CREATE operation not permitted")
I don't know if was changing something, in my old app in security role, the box "create" is flagged. In new app, inside security role in CloudKit dashboard:
if I create new Security Role, its possible to check Create:
But how can I assign this role to all users? the simple save record code:
let record = CKRecord(recordType: "VIP",
recordID: CKRecord.ID(recordName:"idnumber0000001"))
record["firstName"] = "Simone"
let publicDatabase = CKContainer.default().publicCloudDatabase
publicDatabase.save(record) { (record, error) in
if (error != nil) {
print("\(String(describing: error?.localizedDescription))")
}
else {
print("record saved")
}
}