如何获取列表类型查询的Firestore安全规则阵列限制的值?
我正在制作一个查询,例如db.Collection('eaccept')。其中('access.users','array-contains',[user1.ref])
user1.ref 是
documentReference
对用户集合中的文档中的一个,该文档使该用户能够读取此帐户及其子收集,例如
firebase安全规则模拟器中的ACL,如果我调试属性resource.data.access.users
我可以看到那是类型benter> constraint_value
。而且我可以看到我传递的数组的值:
constraint_value {
simple_constraints {
comparator: LIST_CONTAINS
value {
path_value {
segments {
simple: "databases"
}
segments {
simple: "(default)"
}
segments {
simple: "documents"
}
segments {
simple: "users"
}
segments {
simple: "account-1"
}
}
}
}
}
但是如何在安全规则中获取此Condect_value
hasonly()或hasall()
的列表方法检查权限,
没有value
属性或value> value()
方法和实际上constraint_value
文档中没有任何类型的接口。
I am making a query like db.collection('accounts').where('access.users', 'array-contains', [ user1.ref ])
user1.ref
is a DocumentReference
to a document in the users collection that enables this user to read this account and its child collections, like an ACL
In the Firebase security rules emulator, if I debug the property resource.data.access.users
I can see that is type constraint_value
. And I can see the value for the array I passed:
constraint_value {
simple_constraints {
comparator: LIST_CONTAINS
value {
path_value {
segments {
simple: "databases"
}
segments {
simple: "(default)"
}
segments {
simple: "documents"
}
segments {
simple: "users"
}
segments {
simple: "account-1"
}
}
}
}
}
But how can I get the actual LIST value (in this case a LIST of of user references) of this constraint_value
in the security rules so that I can check permissions using a LIST method like hasOnly()
or hasAll()
There is no value
property or value()
method and in fact constraint_value
isn't any type of interface in the docs ....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论