Firebase安全规则基于userId属性

时间:2015-10-15 03:58:35

标签: firebase firebase-security

请参阅我的Data Structure

$dateStart= date('Y-m-d');
$dateExpired = date('Y-m-d', strtotime($dateStart. ' + 30 days'));
$dateExpired2 = date('Y-m-d', strtotime($dateStart. ' + 90days'));

$status = "FRESH";

if(strtotime($dateStart)<strtotime('-30 days')){
   $status = "INACTIVE";
}

if(strtotime($dateStart)<strtotime('-90 days')){
   $status = "DORMANT";
}

//Run sql update query to set status

我正在尝试根据userId属性提供访问权限。它说拒绝接入。

"errands" : {
  "-K0dGrAo6vSqKHRwiAJQ" : {
    "name" : "Milk",
    "permissions" : [ {
      "userId" : "ca8d19cb-f1d7-4bfd-9471-fb88c469b6ca"
    }, {
      "userId" : "ef4bacad-d713-47ac-853e-b3ec3e4bf684"
    } ],
    "store" : "Coscto"
  },
  "-K0dHsTSyrfm3uZjptNN" : {
    "name" : "Milk",
    "permissions" : [ {
      "userId" : "ca8d19cb-f1d7-4bfd-9471-fb88c469b6ca"
    }, {
      "userId" : "ef4bacad-d713-47ac-853e-b3ec3e4bf684"
    } ],
    "store" : "Coscto"
  }
}

0 个答案:

没有答案