Description
Describe your issue in as much detail as possible.
_User class has public read/write CLP; UserProfile class has read/write CLP
As a user, when running a GET on a _User object which contains a pointer to a UserProfile object, the result returns a non-existent value for UserProfile.
When running the same using MasterKey, result comes back as expected. When changing CLPs on UserProfile to public read/write, things work as expected.
This scenario works in our current implementation on Parse.com.
Steps to reproduce
Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.
- Create a UserProfile class that has a field which is a pointer to _User
- Add a CLP on this class with only read/write permissions (no Public permissions)
- Create a pointer field in _User called which which points to UserProfile (hence creating a two-way relationship)
- Create an object in both _User and UserProfile which point to each other via the and fields respectively.
- Query the _User object as the user themself and
include=userProfile
Expected Results
You would expect something like the following
{
"createdAt": "2015-10-05T07:55:55.124Z",
"email": "xxx@yyy.com",
"name": "Users Name ",
"objectId": "ungxXVTqP4",
"sessionToken": "r:xxxxxxxxxxxx",
"updatedAt": "2015-10-05T07:55:56.791Z",
"userProfile": {
"__type": "Object",
"className": "UserProfile",
"createdAt": "2015-10-05T07:55:55.679Z",
"objectId": "DbGP97sT7j",
"updatedAt": "2015-10-05T07:55:55.679Z",
"user": {
"__type": "Pointer",
"className": "_User",
"objectId": "ungxXVTqP4"
}
},
"username": "user@name.com"
}
Actual Outcome
{
"createdAt": "2015-10-05T07:55:55.124Z",
"email": "xxx@yyy.com",
"name": "Users Name ",
"objectId": "ungxXVTqP4",
"sessionToken": "r:xxxxxxxxxxxx",
"updatedAt": "2015-10-05T07:55:56.791Z",
"username": "user@name.com"
}
Environment Setup
- Server
- parse-server version: 2.2.15
- Operating System: Mac OSX 10.11.5 (local NodeJS)
- Hardware: MacBook Pro (Retina, 13-inch, Late 2013)
- Localhost or remote server? Localhost
- Database
- MongoDB version: 3.2.1
- Storage engine: wiredTiger
- Hardware: Local - same as above
- Localhost or remote server? Local
Logs/Trace
You can turn on additional logging by configuring VERBOSE=1 in your environment.
The trace is the Actual Outcome section above with some obfuscation.