key - 运行时异常 : only ACLs can be stored in the ACL key in android

标签 key store acl parseexception back4app

在 android 中,我在后端使用 Parse 和 back4app.com,每当我在返回保存回调中使用 myParseobject.saveInBackground() 时,我都会收到错误消息,指出 ParseException:只有 ACL 可以存储在ACL key 如果有人对此有任何想法,请分享。

最佳答案

每当您使用 saveInBackground() 方法保存 ParseObject 时,您需要执行 YourParseObject.setAcl(your_Acl_Object_here); 您可以从下面找到工作代码,

对于公共(public)访问你可以这样写,

ParseUser currentUser = ParseUser.getCurrentUser();
ParseACL acl = new ParseACL(currentUser);
acl.setPublicReadAccess(true);
YourParseObject.setACL(acl);

如果您只想使用 CurrentUser 访问权限,您可以这样写,

ParseUser currentUser = ParseUser.getCurrentUser();
ParseACL acl = new ParseACL();
acl.setReadAccess(currentUser,true);
acl.setWriteAccess(currentUser,true);
YourParseObject.setACL(acl);

关于key - 运行时异常 : only ACLs can be stored in the ACL key in android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42831154/

相关文章:

mysql - 如何使用mysql将视频存储在数据库中?

php - 如何在我的 Web MVC 应用程序中实现访问控制列表?

python - 从 Python 字典 : 中的值中查找键

javascript - Astro.js通过jwt和store实现auth

c# - Visual C# - 可以记住用户输入的简单程序?

cakephp acl 控制插件的访问(FullCalendar)

windows - LogonSessionId 帐户在新证书中分配了读取权限?

java - 加密解密我自己的 key 未生成java

linux - sshd 上的算法密码

c# - 按顺序枚举 Dictionary.KeyCollection