我的firebase存储空间中有这样的文件夹:
userid1_userid2/image.bmp
OR
userid2_userid1/image.bmp
如何仅向具有userid1或userid2的用户授予对这些图像的访问权限?我尝试了几件事,但文档对我来说并不是很清楚。
答案 0 :(得分:1)
使用这些规则解决:
service firebase.storage {
match /b/{bucket}/o {
match /{path}/{spath} {
allow read,write: if path[0:28] == request.auth.uid || path[29:57] == request.auth.uid;
}
}
}