How to add data into another users blockstack username/id using

Lets assume we have two blockstack id Eg. me.id.blockstack and my_sister.id.blockstack

I and my sister are running a provision store. Now I want when I add provision data(Eg. Milk) to my gaia. I want it to be
posted to my sister as well via her blockstack Identity(my_sister.id.blockstack). I guess I need something like input form where I can enter her id as well

With the reactjs code below, I can only add and retrieve provision data for myself only.

I just need to post provision data to her id(my_sister.id.blockstack) or whatever. Any work around will be appreciated.

Thanks

//To post
const options = { encrypt: false }
userSession.putFile(‘provisionStore.json’, JSON.stringify(provisions), options)

// To get
const options = { decrypt: false }
userSession.getFile(‘provisionStore.json’, options)
.then((file) => {
var provisions = JSON.parse(file || ‘[]’)
this.setState({
person: new Person(userSession.loadUserData().profile),
username: userSession.loadUserData().username,
pIndex: provisions.length,
provisions: provisions,
})
})

It looks like the issue was solved on https://github.com/martin45bc/testing/issues/1

Thanks for reaching out to me @friedger. the issue is not yet resolved. the link above only resolved how to get users publick key.
My major issue is still unresolved.

Posting and Recieving of the post by the other user not working…

I have gotten the recipient publickey through massive help @dant. and @friedger.

Now my major problem is posting data
to other user via userid in this
case mysister.id.blockstack

below is how I post data to another userid

const mysyster_Publickey ="xxxxxxxxxxxxxxxxxxxx";
const mysister_id ="mysister_fake.id.blockstack";


// Post to another block userid(Eg. mysister.id.blockstack)
userSession.putFile('provision.json', '100 Cartoon of Provision in the Store', { encrypt: mysyster_Publickey, username: mysister_id })

For my sister to get post I sent to her I did this but she is not getting any post.nothing from her end. She can only see what
she posted herself and not what I posted to her

userSession.getFile('provision.json', { decrypt: true});

Any solution will be appreciated.

Here is the sample link at github showing the issue
https://github.com/martin45bc/testing2/issues/1

I ran into this same issue when trying to share data across users on gaideo.com. I had to shift my thinking to come up with a solution. The problem is that if you can write data to another user’s data store you can potentially get into scenarios where one user will maliciously write data to another users’s data. Once you start thinking about Gaia not always being unlimited and free, that can become an attack vector for someone to exploit.

So to come up with a solution the way you would like it to work, I think there would have to be some Gaia storage level way to grant permissions to certain users/applications to write data to their storage. That could start to be cumbersome and not user friendly at scale.

The approach I ended up taking was to index the data across users so that you have easy access pointers to all of the data. If your application lets each user specify a list of “friends” to aggregate from. you can start to build index files in the logged in user’s storage to data that exists on your “friends” Gaia storage.

@models-72 This might be something to add here for Mike’s potential grant ideas around Gaia Development of Gaia Technology