One thing that I have always been a little confused about is @auth. What @auth setting makes data publicly readable (like on reddit/instagram), but otherwise protected? Do I always need to register and login to access data?
I see that reddit post does not have @auth at all, does that mean it's completely public, anybody can read and write?
And the reddit comment has @auth(rules: [{allow: owner, operations: [create, update, delete]}]), why is it different from a post?
Thank you for taking time to come up with all of these examples :D
Hey Herman, thanks for pointing this out! The Post type should indeed also have auth rules. The operations: [create, update, delete] setting will allow anyone to query & view the posts, but only the creator to be able to update and delete.
I've updated the post to reflect this change.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Wow 🤩great post!
TIL about @key and @function.
One thing that I have always been a little confused about is @auth. What @auth setting makes data publicly readable (like on reddit/instagram), but otherwise protected? Do I always need to register and login to access data?
I see that reddit post does not have @auth at all, does that mean it's completely public, anybody can read and write?
And the reddit comment has
@auth(rules: [{allow: owner, operations: [create, update, delete]}])
, why is it different from a post?Thank you for taking time to come up with all of these examples :D
Hey Herman, thanks for pointing this out! The
Post
type should indeed also have auth rules. Theoperations: [create, update, delete]
setting will allow anyone to query & view the posts, but only the creator to be able to update and delete.I've updated the post to reflect this change.