ios – Firebase guidelines to beat “Lacking or inadequate permissions” when deleting the paperwork created by the consumer


I’m growing an IOS app which lets consumer delete the paperwork created by them.

I’m utilizing the next:

Collection_Ref.doc(docId).delete()

This works completely positive once I use the under database guidelines:

service cloud.firestore {
  match /databases/{database}/paperwork {
    match /{doc=**} {
       enable learn, write;
    }
  }
}

The above rule is okay for growth. I can see this answer in different stack overflow questions too.

However once I use the under rule, the documentnts will not be deleted and I get the message “Lacking or inadequate permissions”:

service cloud.firestore {
  match /databases/{database}/paperwork {
    match /{doc=**} {
      enable learn, write: if request.auth != null;
    }
  }
}

What I need: I wish to use “enable learn, write: if request.auth != null;” and have the ability to delete the consumer’s paperwork. Please recommendation.

I additionally tried the under guidelines, however I could not even login with these:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/paperwork {
    match /{doc=**} {
       enable learn, write: if request.auth != null && request.auth.uid == useful resource.knowledge.writer;
    }
  }
}

See also  ios - How you can create a reusable button class with a stack view in UIKit?

Leave a Reply