DEV Community

Discussion on: Dart x Flutter MokuMoku Live Coding 26/09/2020

Collapse
 
kyorohiro profile image
kyorohiro (kiyohiro kawamura) • Edited

Firebase
give a user permission to the user directory

stackoverflow.com/questions/636040...

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{uid}/{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

PS
this is wrong

Collapse
 
kyorohiro profile image
kyorohiro (kiyohiro kawamura) • Edited

Firebase Storage Rule

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{uid}/{allPaths=**} {
      allow read, write: if request.auth.uid == uid;
    }
  }
}

Firebase Store Rule

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{uid}/{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

[ref]
medium.com/@khreniak/cloud-firesto...