我想对数据库中的存储规则进行动态控制。我的意思是它应该检查数据库节点以允许读取或写入。
但是我找不到办法。
例如
match /files/{fileKey} {
allow read: // here will check db to get result of allowRead
allow write: // here will check db to get result allowWrite
}
D b:
files: {
fileKey1: {
allowRead: true,
allowWrite: false
},
fileKey2: {
allowRead: true,
allowWrite: true
}
最佳答案
无法从Firebase存储安全规则中检查Firebase数据库。
您必须将必要的信息嵌入到存储安全规则中,或者embed it in the user's token as a custom claim。