Cloudkit Write Permission error for some records

I have a Mac OS X app which has around 15 tables. These have worked fine for multiple years. I am in development mode for this container. I recently added a new table, adding it automatically as I created records from the app. I have created about 10 sample records in it, some from a different machine than my dev Mac. For 2 of these records, in an attempt to save, I get this error:

<CKError 0x600000d7b5d0: "Permission Failure" (10/2007); server message = "WRITE operation not permitted";


From the dashboard on my dev Mac, I can retrieve the record, changed it, and save from there.




Answered by digitalglen in 371613022

When I recently encountered something similar, the problem was resolved when I editted permissions in Schema > Security Roles.

BTW, I am able to save the other records successfully from the app.

Accepted Answer

When I recently encountered something similar, the problem was resolved when I editted permissions in Schema > Security Roles.

Thanks, digitalden

That worked. I had to check read and write for that table. Funny that I could save most of the records.

What does this mean Spok?

Schema? Security Rules? What? Where are these things?

On your simulator or you iPhone, go to setting and sign-in to iCloud. Users are not allowed to WRITE (CREATE) records to CloudKit unless they are signed-in to Apple iCloud. This is what causes this Permission Error. Apple should obviously add more color to their error; it shouldn't be so hard for devs to debug it (but it is).

> Schema? Security Rules? What? Where are these things?


Xcode, select the target app, Signing & Capabilities,CloudKit Dashboard

Select the container for the app on CloudKit

This gets you to the CloudKit Dashboard.


Select Development. (this may be a drop down menu at the top labelled Production)

Select Schema. (this may be a drop down menu at the top labeled Data)

Select Security Roles (This may be on a drop down menu at the top labelled Record Types)

Select the permissions for World, Authenticated and Creator.

Then you may need to deploy to production.

Cloudkit Write Permission error for some records
 
 
Q