2016-08-17 80 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