Story: I'm developing simple Angular web-app using Parse Platform for backend and straight API calls (no parse platform libraries). I have couple of tables and login - everything is working. However it came time to restrict access via Access Controls such that one user can't access data of another and here we I hit a problem.
Question: Given user is logged in, how to default newly created/updated object to have ACL specifically to the creator (currently logged-in user)?
Additionally:
The easiest way is through beforeSave
trigger. It would be something like this:
Parse.Cloud.beforeSave('MyClass', ({ original, object, user }) => {
if (!original) { // New object is being created
object.setACL(new Parse.ACL(user));
}
});