我想授予用户类似的权限。
match /images/{userId}/{allPaths=**}但是我的firebaseStorage路径是这样的。
match /images/user/userId_user.jpg所以我不知道如何匹配这些路径。
然后..。如果你知道使用uid,就不要使用match {userId}<-就像这样。
亲切的问候。
发布于 2017-03-01 23:55:03
我建议以不同的格式存储您的文件,以使此操作更容易:
match /users/{userId}/images/{imageId} {
allow write: if userId == request.auth.uid;
}它可以与/users/userId/images/user.jpeg匹配
但是如果你已经使用了这种格式,你很幸运我们提供了字符串和正则表达式匹配:
match /images/user/{userImageName} {
// If you know it'll be just a straight string match, go for it
allow read if: userImageName == request.auth.uid + '_user.jpeg';
// Otherwise match using a regular expression
allow write if: userImageName.matches(request.auth.uid + '_user.jpeg');
}https://stackoverflow.com/questions/42513762
复制相似问题