2016-08-17 79 views

回答

4

TL; DR:在Storage Security Rulesrequest.resource〜= newData.val()resource〜= data.val(),所以你同样可以使用它们。

service firebase.storage { 
    match /b/<bucket>/o { 
    match /path/to/file { 
     allow write: if resource == null; // if !data.exists() in DB land 
    } 
    } 
} 
+1

我有同样的问题,但它不工作。 – ocanal

+0

@ocanal你能提供超出“它不工作”的信息吗 –

+0

我的存储是空的,我在你写的时候设置规则,我总是得到 {code:403,消息:“Permission denied。Could not perform this operation”} error 。我的存储空间仍然是空的。如果设置允许写入:true,我可以上传。 – ocanal