-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse.Object.save throws wrong "101 Object not found." error #9649
Comments
🚀 Thanks for opening this issue! ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing. |
Seems the correct error code to me, if the session token is valid and the user has neither read nor write permission. The point is that without read permission, it shouldn't even be revealed that the object exists, so "not found" makes sense. If the user had read permission but no write permission, it may be debatable whether the response should be "not found", or a more specific "op forbidden". In fact "not found" could be confusing as an error, but it's unlikely to cause any significant inconvenience compared to a more specific "op forbidden" error code. Please explain why you think that error code was incorrect. |
@mtrezza but in this case the user has read permissions, it only lacks write permission. That's why |
I think we could probably change it. Otherwise there would be an additional query needed to differentiate between whether the object really does not exist or only the write permission are missing. The question is what's needed to change the error. If the auth logic requires a broader restructuring then it may not be worth the hassle. Do we have an existing error code you'd suggest? |
New Issue Checklist
Issue Description
Parse.Object.save throws "Object not found.", code 101 error when trying to save an existing object with the session token of a user that does not have write permissions on that object.
Steps to reproduce
Fetch a valid object that can be read by everyone, using a query.
Set any value on the object and try to save it using the session token of a user who does not have write access for the object.
Actual Outcome
101: OBJECT_NOT_FOUND error is thrown.
Expected Outcome
Other error should be thrown:
Environment
Tested on the versions mentioned below only.
Server
8.0.0
Ubuntu
Self Hosted Remote
Database
MongoDB
7.0.14
Self Hosted Remote
Client
JavaScript
6.0.0
The text was updated successfully, but these errors were encountered: