How can I get a field value from the firestore database, in my cloud storage rules?
I have the following path to an image in my cloud storage bucket:
/users/userId123/myimg.png
now when someone tries to access thst, I want to read the following firestore database field:
/users/userId123/public
If public is true, anyone should be able to see this image. If not, only the user should be able to see it.
Always, only the user should be able to write to the file.