[英]firebase realtime database rules to allow multiple uid for write access
I need to allow only 2 specific uid for write access and I can't publish with my current rule:我只需要允许 2 个特定的 uid 进行写访问,我不能用我当前的规则发布:
{
"rules": {
".read": "auth != null",
".write": "auth != null && auth.uid === 'abc123' || '123abc'",
}
}
It keeps complain "rule regulation may not contain '|'它一直抱怨“规则规定可能不包含'|' operator" and "right operand for '||'
运算符”和“'||'的右操作数must be boolean", which ever i used.
必须是布尔值”,这是我曾经使用过的。 How should I change my rule to achieve what I want?
我应该如何改变我的规则来实现我想要的?
Any help will be much appreciated.任何帮助都感激不尽。
The word after || || 之后的词is actually not a boolean, it is just a string.
实际上不是 boolean,它只是一个字符串。 Please, check my fixed code.
请检查我的固定代码。
{
"rules": {
".read": "auth != null",
".write": "auth != null && (auth.uid === 'abc123' || auth.uid === '123abc')",
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.