juno icon indicating copy to clipboard operation
juno copied to clipboard

Can I set document owner from node.js code?

Open CodingFu opened this issue 5 months ago • 3 comments

Hi @peterpeterparker.

I have an identity that is satellite controller. Let's say principal id is aaa-aaa-aaa I have a user in juno, their principal is bbb-bbb-bbb

I want to setDoc on behalve of the user from node.js using controller identity.

When I do

await setDoc({
  collection: "receipts",
  satellite: {
    identity: myControllerIdentity,
  },
  key: nanoid(),
  owner: "bbb-bbb-bbb",
  doc: {
    date: '2024-04-04',
    ...
  }
})

I expect resulting doc to be owned by the user (bbb-bbb-bbb), but it still belongs to the controller principal(aaa-aaa-aaa).

Do I miss something? Is this possible with rust juno client? Is it possible at all?

CodingFu avatar Sep 17 '24 15:09 CodingFu