First, make sure the latest Firestore rules are deployed:
firebase deploy --only firestore:rules- Run the application locally or go to the deployed app
- Sign up for an account with your admin email
- Complete the signup process
- Log in to the application
- Go to Firebase Console
- Select your project
- Click Authentication in the left sidebar
- Find your email in the users list that you want to set as an admin
- Copy the User UID
Now add your UID to the admins collection in Firestore:
- Go to Firebase Console
- Select your project
- Click Firestore Database in the left sidebar
- Click Start collection (if admins collection is not already created)
- Collection ID:
admins - Document ID: Paste your User UID here
- Add field:
- Field:
email - Type:
string - Value: The email address you signed up with that you want to designate as an admin
- Field:
- Add another field:
- Field:
createdAt - Type:
timestamp - Value: Enter current date/time
- Field:
- Click Save
- Refresh your application (or log out and log back in)
- You should now see "Admin Approval" in the menu sidebar
- Click on it - you should have full access to a list of users who signed up with the ETS or Vendor role.
- You're now an admin and can approve or deny accounts that signed up as an ETS or Vendor.
Once you have admin access, you can add other admins:
- Ask the new admin to create an account first
- Get their User UID (from Firebase Console > Authentication > Users)
- Go to Firestore Database
- Open the
adminscollection - Click Add document
- Document ID: Their User UID
- Add fields:
email(string) andcreatedAt(timestamp) - Save
To remove admin privileges:
- Go to Firebase Console > Firestore Database
- Open the
adminscollection - Find the document with the user's UID
- Click the three dots menu on the left-hand side → Delete document
- Confirm deletion
Problem: Logged in but don't see the admin menu option
Solutions:
- Verify your UID matches the document ID in the
adminscollection - Make sure the
adminscollection exists in Firestore - Check that Firestore rules are deployed (
firebase deploy --only firestore:rules) - Try logging out and back in
- Check browser console for errors
Problem: Can see the menu but get access denied
Solutions:
- Verify the document ID in
adminscollection matches your User UID exactly - Check that the document exists and isn't empty
- Firestore rules might not be deployed - run
firebase deploy --only firestore:rules - Clear browser cache and reload
Problem: Firebase Console won't let you create the admins collection
Solutions:
- Make sure you have Owner/Editor role in Firebase project
- Check that Firestore is enabled for your project