0

I am new to ios development. I am planning to use public database of cloudkit to store user's data.

I want to set security roles such that only creator of the record can access it. No other user (even authenticated) can access (not read/write) the record. Suppose, I deploy the application and users are using it and creating records.

Now In future, while giving update to this application, if I want to change the security roles, and give authenticated users, the permission to read the records created by other users.

Is this possible? and If Yes then the records which are created earlier (before the updated version ) can now be accessed (read )by authenticated users?

Thanks in advance,

Krishna

Krishna
  • 71
  • 3

1 Answers1

1

Krishna, CloudKit doesn't work quite that way. The public zone is always public - everyone using your app can access these. If they are logged in it is possible to set it so anyone can write to the public database. The private database is where you store user specific records that only they can see. If you later want to share with other users you then use use the shared database.

This thread is on a similar topic

Designing for CloudKit is a helpful overview

This WWDC video goes into the specifics of sharing using Cloudkit

Brian M
  • 3,812
  • 2
  • 11
  • 31
  • Hi Brian, Thank you for your reply. I have referred this link http://blog.krzyzanowskim.com/2016/03/08/cloudkit-security/ and set up roles accordingly. (I mean only creator can access the data ) I have checked in development environment and confirmed that the security roles works properly. So you want to say that in production environment, I can not set security roles and data stored in public zone will be accessible by all the users of my application? – Krishna Nov 09 '17 at 07:55
  • Krishna my answer isn't correct - you are. It sounds like if at a later time you want to expand that access to allow other users to view or edit existing records you would handle that in the app itself, using a hybrid of these security roles and some kind of flag on the entries themselves. I already gave one incorrect answer though so I should probably stop there... I'm assuming you saw [this thread](https://stackoverflow.com/questions/31369181/how-do-the-cloudkit-security-roles-and-permissions-work) and [this thread](https://stackoverflow.com/questions/35829653/cloudkit-security-roles)? – Brian M Nov 09 '17 at 12:43