Reputation: 179
I am making a web app but I'm a little confused as to how I should give elevated permissions for the administrators. For instance, here, I want regular users to be read-only and admins to obviously have read and write permissions. How should I go about defining that? Any insight would be very much appreciated!
Upvotes: 3
Views: 1003
Reputation: 1001
You want to add custom claims to your user accounts. It is also common to add a 'role' field (or similar) to user documents in Firestore.
That alone doesn't do you any good. You also need to protect your reads and writes with Firestore security rules where you can check if the user requesting a resource has a access to the document.
Upvotes: 3