I have a class where each object’s ACL is public-read but write is limited to the user who created it. Let’s say it’s a Post
class in a news feed.
When someone else ‘likes’ this post, I want to store a new Like
object , with a pointer to the liked post
. However, the save fails with a 101
error which I have discovered is due to the liked post
's ACL. If I make the liked post
publicly writable, the save operation is successful.
I can think of a couple of workarounds - storing the object ID instead, or using cloud code - but they are not very graceful and seem like they shouldn’t be necessary.
My questions:
- Is this expected behavior?
- What is the rationale for this behavior? Why wouldn’t a publicly readable object be storable as a pointer in another object?