Start a new topic
Answered

Changing the owner of a record via console or API?

Hi


As an admin I need to create a new data record on behalf of my user but I have noticed I can not change the "creator" attribute in the _acl field - even if I am logged in with the master key. Is there a way to change the owner of a record or create a record on user's behalf?


Thanks



Best Answer

Hi Daniel,


You can achieve this with Kinvey API console.

  • Make POST request to the collection you want.
  • Use master secret for authentication.
  • In request body, include _acl property as below along with all other columns-values: "_acl": { "creator": "<id of user you want as creator>" }

Using Kinvey console or API PUT request, you cannot edit the _acl.creator property once the object is created.

Let me know if this is helpful.


Regards,
Wani
Kinvey Support


Hi Wani, I understand, I can create but not change. Thanks



1 person likes this

Hi Pranav


the problem is that I do not know the passwords of my users - obviously - and I am not going to ask my users to send me their passwords via email. As an admin of the DB I should be able to create a record on their behalf - or change the ownership of a record, but whenever I try to change the _acl.creator via the console it fails. 


Thanks


Answer

Hi Daniel,


You can achieve this with Kinvey API console.

  • Make POST request to the collection you want.
  • Use master secret for authentication.
  • In request body, include _acl property as below along with all other columns-values: "_acl": { "creator": "<id of user you want as creator>" }

Using Kinvey console or API PUT request, you cannot edit the _acl.creator property once the object is created.

Let me know if this is helpful.


Regards,
Wani
Kinvey Support

Daniel,


Through the API Console, you can POST a request as a particular user. (It's under the "Authentication" option).  Attached is a screenshot where you can login as a specific user and then run the POST request and check "_acl.creator" for the newly posted entry.

Let me know if this works for you.





Thanks,

Pranav

Kinvey Support


Login or Signup to post a comment