Allow admins to see private-users info
This commit is contained in:
parent
98064119e1
commit
e7ef6134b5
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
"functions": {
|
"functions": {
|
||||||
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
|
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
|
||||||
"runtime": "nodejs12"
|
"runtime": "nodejs12",
|
||||||
|
"source": "functions"
|
||||||
|
},
|
||||||
|
"firestore": {
|
||||||
|
"rules": "firestore.rules"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,22 @@
|
||||||
rules_version = '2';
|
rules_version = '2';
|
||||||
|
|
||||||
|
// To deploy: `firebase deploy --only firestore:rules`
|
||||||
service cloud.firestore {
|
service cloud.firestore {
|
||||||
match /databases/{database}/documents {
|
match /databases/{database}/documents {
|
||||||
|
|
||||||
|
function isAdmin() {
|
||||||
|
return request.auth.uid == 'igi2zGXsfxYPgB0DJTXVJVmwCOr2' // Austin
|
||||||
|
|| request.auth.uid == '5LZ4LgYuySdL1huCWe7bti02ghx2' // James
|
||||||
|
|| request.auth.uid == 'tlmGNz9kjXc2EteizMORes4qvWl2' // Stephen
|
||||||
|
|| request.auth.uid == 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // Manifold
|
||||||
|
}
|
||||||
|
|
||||||
match /users/{userId} {
|
match /users/{userId} {
|
||||||
allow read;
|
allow read;
|
||||||
}
|
}
|
||||||
|
|
||||||
match /private-users/{userId} {
|
match /private-users/{userId} {
|
||||||
allow read: if resource.data.creatorId == request.auth.uid;
|
allow read: if resource.data.creatorId == request.auth.uid || isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
match /contracts/{contractId} {
|
match /contracts/{contractId} {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user