Database edit data with ACL: public write , read: user

Hi , I want to edit data in a table with public write and private read , how can I do that ?

What did you try?
There is also CLP

const UserData = Moralis.Object.extend("Notification");

    const query = new Moralis.Query(UserData);

    query.equalTo("ethAddress", router.query.userID);

    const results = await query.first();

it returns undefiend because I set the ACL read:owner and write :public and I don’t know how to target a specific object if it has private read

const notificationsACL = new Moralis.ACL();

      notificationsACL.setPublicWriteAccess(true);

      notificationsACL.setReadAccess(user.id , true)

      noti.setACL(notificationsACL)

      noti.save();

this is the ACL

Did you check the ACL to see if it is as expected?

The ACL is as expected

And if you make the ACL with more rights it works ok your code?

Yes , but i want to make it more secure .

What is the part that doesn’t work? The part with private read? Should’t that be easy as for users by default is private write and private read?

Yes the private read , I can’t target the field , I want to edit that field from another account , practically want everyone to be able to send friend requests but only the owner to see them.

And now what doesn’t work?

I’m trying to target the notification field but the ACL is set to private read so the query returns null and I’m asking how can i target the notification field to edit it .

const UserData = Moralis.Object.extend("Notification");

    const query = new Moralis.Query(UserData);

    query.equalTo("ethAddress", router.query.userID);

    const results = await query.first();

this query that returns null

Can you try without equal to, as it should only return the rows that you can read?

It returns my own , but i want to edit other users rows so I can push notifications.

How you want to edit them if you can not read those entries? You could use master key in cloud code

Ok , thank you , I will try.