Start a new topic

Resolving "KinveyRefs" (and creating relational data from the server)

Little background:



Our app allows users to collaborate on an entity. We're adding users into the "r" and "w" for _acl's, which seems to work. We have associated "topics" which users can upload files (using KinveyFile).



As one user, I can successfully upload and associate a file to an entity. It seems that as the other user in this scenario, when I refresh my page and re-query for the files, the file that was uploaded by the other user is not being resolved properly and returns as a regular "KinveyFile".



See response in the "files" here:

https://gist.github.com/dmackerman/1a138889073ff581ff9d#file-response-json-L37-L40



Any ideas on why it's not resolving properly for the other user? As a single user executing the same workflow, the files resolve properly.

Looking at how we handle public files, it looks like you still need the r/w settings when embedding the file as KinveyRef.
Mark, the file is definitely public. We're not setting "r" and "w" values yet, though.



$kinvey.File.upload(fileContent, {

_filename: file.name,

mimeType: file.type,

size: file.size,

starred: false,

uploadedBy: $scope.user,

uploadDate: Date.now()

}, {

public: true

});
Did you also set the "r" and "w" on the file ACL? It looks to me the unresolved file is either not public, or lacking the appropriate r/w values.
The 2nd part of my question involved creating relational data from custom BL, but it seems like that can be accomplished by simply embedding "KinveyRef"'s manually:

http://devcenter.kinvey.com/rest/guides/datastore#RelationalData
Login or Signup to post a comment