-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Parse-server returning empty results unless using master key when ACL set. #1084
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
Comments
cc @drew-gross |
This seems like an ACL or CLP issue in the server. @oli107 can you provide the CLPs for your _User collection (found in the _SCHEMA collection), as well as the contents of the database for the |
SCHEMA for User: Database content for user (note role contains mildly sensitive data, so replaced role name as role_admin. Is usually [name]_admin): |
I believe I have found the issue although I may be way out of my depth.
As such, in the RestQuery.js line 41 onwards is never called because it is never the case that both the class name is _Session, and the masterkey is false. This means the "restwhere" adding the user object id is never included.
|
Not sure wether this is related but querying for Parse.Roles also always returns an empty array:
My Query (role of user = admin)
Result is empty array (Parse-Server version 2.2.2) EDIT: |
@oli107 is it only occurring for _User or other classes too? |
It seems like if the "Public" ACL is not set to true then it will never return anything unless you set the MasterKey. For me this happening on other classes too. I'm using Parse Server 2.2.6. My class Client has full read/write/find/etc CLP permissions. The ACL on the record I'm expect is: I then query using the new Parse Dashboard and set run as to be the objectId of the User "Dd0TeojH82" and I don't get back the records. No query parameters set. If I add "Public Read" permissions then I see it in the response |
This was occurring on all classes but I think this may be an issue with the parse-dashboard not setting the user on the request correctly as opposed to an issue with Parse Server. Like others, I was lost for a bit of time on the fact that any requests using parse-server need to pass either a session token or a masterkey boolean in the options. Documentation on that was quite sparse, I think it is improved now? |
I should've added that it also fails in my app when I send the sessionKey too for that specific user. |
I take that back - it looks like for some reason when i was testing I'd got logged out from Parse so the session key I was trying was invalid - as @oli107 says perhaps this should be closed and re-opened under the parse-dashboard. |
This is happening to me in curl as well. Self write permissions are set for users but I get 206 error when I try to do so without the master key.
Then I call a post that saves something and then triggers some after save code where I try to update the
In the afterSave I try to save the
If I add I am using Parse Server v2.2.6. |
I found what I was doing wrong in #1090.
So, I needed to:
|
For implementation related questions or technical support, please refer to the stackoverflow community.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
Environment Setup
parse-server 2.1.6 running locally and on Heroku
Database migrated to mLab
Steps to reproduce
Issue
Using the dashboard (running locally) as well as using Cloud Code and parse JS functions, queries are reporting empty unless using the master key is used in the copied database. These queries return as expected via the Parse.com API. Both are using the mLabs hosted database as migration is complete so it does not appear to be related to the database structure. All data appears correct within the database, and when using the master key to view records or the dashboard browser the ACL appears correct. It does not work when the ACL is set to a role nor when it is set to an individual user.
Screenshot attached running side by side off the same parse-dashboard. Window on the left = database hosted on mLab and server on heroku, window on right = parse.com.
The text was updated successfully, but these errors were encountered: