Hello Guys, why this error happen? i simulated to create in `config/webAdmin` buat i got error and the rule not overriding
here is the code :
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
match /config/webAdmin {
allow read;
allow write: if userIsAdmin();
}
function userIsAdmin() {
let userData = getUserData().data;
return ("isHR" in userData) ? userData.isHR : false;
}
function getUserData() {
let userNip = path(get(/databases/$(database)/documents/users/$(request.auth.uid)).data.nip);
return get(/databases/$(database)/documents/$(userNip));
}
}
}
