From the course: React: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Cloud Storage security rules

Cloud Storage security rules

From the course: React: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Cloud Storage security rules

- As of now any authenticated user will be able to upload files. While this may work for many applications, in our specific scenario, users will be uploading the profile image at a specific location in our storage bucket. We only want that user to have read and write access to that location. We will also be working on an adamant interface to allow a user with an administrative role to access this as well. We will be uploading the user images to a specific path related to the user's ID, so we can change the match condition. Back slash users, the user ID, and forward slash the file name. And then we want to allow read and write to that location, if the authenticated user matches that ID. This will prevent a user from writing to a location that doesn't belong to her. Let's go ahead and allow read. If the ID from the authenticated user matches the user ID at the location they are trying to write. And we want to…

Contents