About Databases in Changing Access Controls on User Data

I am following apple docs about "Changing Access Controls on User Data".


https://developer.apple.com/documentation/cloudkit/changing_access_controls_on_user_data


It works ok for privateCloudDatabase, but if I made the changes in the code to use instead publicCloudDatabase or sharedCloudDatabase and also modify the apiPath to use the appropriate database an error is show.


In case of using the publicCloudDatabase the error is the following:


"serverErrorCode" : "BAD_REQUEST", "reason" : "BadRequestException: endpoint not applicable in the database type 'publicdb'"


In case of using the sharedCloudDatabase the error is the following:


"serverErrorCode" : "ACCESS_DENIED", "reason" : "private db access disabled for this account"


(Please note also that strangely, in the last error message references private db and not shared db)


Is it possible to temporarily deactivate or restrict access to the data associated with a user in publicCloudDatabase and sharedCloudDatabase?

Accepted Reply

This api restricts the user’s data. In the public database all records are available to everyone. Therefore there is no ‘user’s data’ in the public database. The ‘shared’ database is just records within a user’s private database for which certain specific other users have been granted access by the user themself.

Replies

This api restricts the user’s data. In the public database all records are available to everyone. Therefore there is no ‘user’s data’ in the public database. The ‘shared’ database is just records within a user’s private database for which certain specific other users have been granted access by the user themself.

Thanks for your answer.