[英]Why can't I save() to this Parse.Object?
使用以下代碼,我能夠成功創建一個Parse.Object,並在數據瀏覽器中查看它:
// This code executes correctly:
var UPrefs = Parse.Object.extend("uPrefs");
var uPrefs = new UPrefs();
uPrefs.setACL(new Parse.ACL(Parse.User.current()));
uPrefs.save();
兌現承諾后,當前用戶將無法再更新對象:
// But then this code throws a 403 error
uPrefs.save();
錯誤詳細信息如下:
code: 119
"This user is not allowed to perform the update operation on uPrefs. You can
change this setting in the Data Browser."
即使數據瀏覽器向創建該行的用戶顯示行集的ACL(具有讀取和寫入權限),然后再嘗試對其進行更新。
誰能發現我在做什么錯?
非常感謝您的幫助!
感謝WandMaker的指導,使我朝着正確的方向前進:
為了解決這個問題,我需要:-在uPrefs
Parse.Object模型中添加一個user
列。 -在類級別權限中添加指向user
列的指針,並將其設置為具有讀取/創建/寫入/更新/銷毀權限。
完成后,以下代碼將起作用:
var UPrefs = Parse.Object.extend("uPrefs");
var uPrefs = new UPrefs();
uPrefs.set("user", Parse.User.current());
uPrefs.setACL(new Parse.ACL(Parse.User.current()));
uPrefs.save();
然后所有將來的save()
調用也都可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.