I have a cloud function that adds records to the “Participant” table. It’s working fine when I turn on all permissions for the public. But when I leave just “read” permission ticked it stops working even though I’m using the master key. What could be the problem?
const ParticipantTable = Moralis.Object.extend("Participant");
const participantInstance = new ParticipantTable();
participantInstance.set("a", a, { useMasterKey: true });
participantInstance.set("b", b, { useMasterKey: true });
participantInstance.set("c", c, { useMasterKey: true });
participantInstance.set("d", d, { useMasterKey: true });
participantInstance.set("e", e, { useMasterKey: true });
participantInstance.set("f", f, { useMasterKey: true });
participantInstance.set("g", g, { useMasterKey: true });
await participantInstance.save({ useMasterKey: true });
I’m triggering this function via a job:
Moralis.Cloud.job("addParticipantJob", (request) => {
const run = async () => await Moralis.Cloud.run("addParticipant");
return run();
});
Thank you