I'd like to setup the rules for my Firebase database such that each authenticated user gets read access to a domain-specific node at: /domains/yourdomain.com
How do I change the following rule to allow for that? As the 'matches' and 'endswith' operator expect literal values, and don't expand the $domain variable.
{
"rules": {
"domains": {
"$domain": {
".read": "$auth.token.email.matches(/.*@$domain$/)",
".read": "$auth.token.email.endswitch($domain)",
}
}
}
}