Hi, I'm planning to give the user an option to design its own selection color for a kinda calendar app.
(Internal CarSharing Planner, to be more precise.)
My idea was to extend the public 'Users' record type by a 'PreferredColor' value, which contains the RGB String representation of that given color.
This works great for the currently logged in user since I'm able to directly fetch the record like so:
var container = CloudKit.getDefaultContainer();
var publicDB = container.publicCloudDatabase;
return publicDB.fetchRecord( { recordName: currentUser.id, zoneID: '_defaultZone' } ) .then(function(response) { /* ... */ }(CloudKit JS)
But as soon as I try to gather the 'PreferredColor' fields of all users I'm stuck.
Directly querying the 'Users' record leads to an error.
[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (query, line 0)That is great for security reasons and all I need to properly assign the user and the color is the recordName and the 'PreferredColor' field of every 'Users' record.
Is it possible to filter the desired return fields in a query?
Or is the whole attempt bad and I should store this UserID:PreferredColor assignment in an own record type?