• Genel Yapamadım
  • App'ten ne zaman çıkış yapsam "permission-denied" error alıyorum.

Arkadaşlar merhaba,
Flutter Getx kullanıyorum. GetxController ile verilerimi Firebase’den çekiyorum. ve bu verilerimi bi class’a kaydedip view page’imde GetBuilder içinde gösteriyorum. GetxController’ımı da main.dart içinde Binding ediyorum. Fakat ne zaman App’imde çıkış yapmak için “FirebaseAuth.instance.singOut();” fonksiyonunu kullanıp çıkış yapsam bana “permission-denied” hatası veriyor. Firestore Rules kısmında bu hatayı vermesini gerektirecek hiçbir sorun olduğunu düşünmüyorum. Çıkış yaptığım halde GetxController’ım Firebase’den “uid” ile veri almaya çalıştığını düşündüm. Sonra controller’ımı dispose edip tekrar firebase’ın çıkış yapmak için kullanılan fonksiyonunu kullandığımda yine “permission-denied” hatası alıyorum. 1 haftadır buna çözüm arıyorum stackoverflow’da bir sürü post açtım hiçbir cevap alamadım firebase’e mail attım geri dönüş olmadı. Artık son ve tek şansım burası sanırım. Yardımcı olabilecek var mı lütfen??

https://stackoverflow.com/questions/76181752/firebase-permission-denied-when-i-log-out?noredirect=1#comment134368620_76181752

aldığım hata açıklaması:
Exception has occurred.
PlatformException (PlatformException(firebase_firestore, com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions., {code: permission-denied, message: The caller does not have permission to execute the specified operation.}, null))

firestore rules

rules_version = ‘2’;
service cloud.firestore {
match /databases/{database}/documents {
match /subscribers/{subscriber} {


    allow get, write:if isSignIn();
		match /sites/{site} {
    	allow read, write: if isSignIn();
      match /messages/{message}{
      	allow read, write: if isSignIn();
      }
    }
}
match /sites/{site} {
	allow read, write: if isSignIn();
}

}
function isSignIn(){
return request.auth.uid ≠ null;
}
}

Write a Reply...