PFUser that created object cannot delete object despite ACL writing access?

江枫思渺然 提交于 2019-12-08 05:13:41

问题


I want to allow users to remove an object from a parse-server database that they created (at some later, desired time).
The object is created in the DB fine, and the .deleteInBackground() command works fine to delete object if I, manually, first set the ACL for that object to allow public writing.
As a default, the user that created the object is allowed to read AND write to it,
yet (despite being logged on) the below function returns an error to the logs in xcode because the user doesn't have permission (the specific error is that the object is not found... but I have deduced this is due to the ACL and manually setting the ACL to allow public writing gets rid of this issue) to remove it.

let removingObjectQuery = PFQuery(className: "GoingTo")
            removingObjectQuery.whereKey("objectId", equalTo: goingToSelectionID)
            removingObjectQuery.findObjectsInBackground(block: { (object, error) in
                if let objects = object{
                    print("Object found")
                    for object in objects{
                        object.deleteInBackground()   
                    }
                }
            })


Why can the object only be deleted if public writing is enabled, despite the user that is logged on having writing privilege on the ACL for that specific object?

来源:https://stackoverflow.com/questions/39844324/pfuser-that-created-object-cannot-delete-object-despite-acl-writing-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!