Home > Software design >  Do Firebase Storage security rules support version 2?
Do Firebase Storage security rules support version 2?

Time:08-27

https://firebase.google.com/docs/rules/rules-language?hl=en&authuser=0#cloud-storage

In the above documentation, it seems to suggest that Storage security rules support version 2 but none of the Storage examples opt into version 2, only the Firestore rules do. Do Storage security rules support version 2?

Also, in my Firestore rules, which opt into version 2, I only grant read and write access to admins up front and any rules subsequent to that are for non-admin access, and it works fine.

rules_version = '2';
service cloud.firestore {
    match /databases/{database}/documents {
        function isAdmin() {
            return request.auth.token.admin == true;
        }

        function isSignedIn() {
            return request.auth != null;
        }

        match /{doc=**} {
            allow write: if isAdmin();
            allow read: if isAdmin();
        }

        // THIS IS EVALUATED FOR NON-ADMIN USERS            
  • Related