云开发 云存储 安全规则 如何设置指定文件夹公共读?

发布于 7 年前作者 guochao5392 次浏览最后编辑 7 年前来自 ask

按照这里的写法但是不行,还是无法公共读:https://cloud.tencent.com/document/product/876/49037

对文件/文件夹访问进行权限控制

在云存储所有的文件中,有2个文件夹,/uploads/public,其中/public公共用户均可访问,/uploads只有创建者可读写。

{
  "read": "/^public/.test(resource.path) || (/^uploads/.test(resource.path) && resource.openid == auth.uid)",
  "write": "/^public/.test(resource.path) || (/^uploads/.test(resource.path) && resource.openid == auth.uid)"
}
0 回复
暂无回复