rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /screenshots/{document} {
    	allow read, write: if request.auth != null && document.matches('^'+request.auth.token.email+'-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
    	allow read, write: if false;
    }
    match /state/{document} {
    	allow read, write: if request.auth != null && document.matches('^'+request.auth.token.email+'-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
    	allow read, write: if false;
    }
    match /{document=**} {
      allow read, write: if false;
    }
  }
}
