【发布时间】:2016-12-21 07:48:31
【问题描述】:
在 FireBase 控制台中,我在数据库中设置了以下规则:
以下是Google电子表格的脚本编辑器:
由于任何人都可以写入数据库,因此不需要权限,直到这里才能写入数据库。
现在我希望只有一个用户可以写入数据库,所以我将规则更改为:
{
"rules": {
".read": true,
".write": "'User_UID_xyz' === auth.uid"
}
}
我使用用户 ID 'User_UID_xyz' 登录帐户,并在 Google Spreed Sheet 中运行相同的脚本。但我遇到了 permission denied 问题。那么,我需要让用户在这里进行身份验证吗?但它已经登录了FireBase认证的账号。
/////////////////////////////////
/////////////////////////////////
另外,我已经浏览了链接:
https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase/tutorials/using-secured-client-authentication-for-real-time-read-and-write-calls
但是我很困惑。为什么我要在这里使用 Web App?
【问题讨论】:
标签: google-apps-script firebase-realtime-database firebase-authentication