Allow protectedFields for Authenticated users and Public. Fix userField with keys/excludedKeys (#6415)

* fix error message and test it

* protected fields fixes

* clean

* remove duplicate test, add some comments

* no need for 'requiresAuthentication'
This commit is contained in:
Old Grandpa
2020-02-19 12:34:08 +03:00
committed by GitHub
parent ca1ae336c9
commit 292bdb713a
9 changed files with 1390 additions and 45 deletions

View File

@@ -6,6 +6,7 @@ import Parse from 'parse/node';
const ALLOWED_GET_QUERY_KEYS = [
'keys',
'include',
'excludeKeys',
'readPreference',
'includeReadPreference',
'subqueryReadPreference',
@@ -69,6 +70,9 @@ export class ClassesRouter extends PromiseRouter {
if (body.include) {
options.include = String(body.include);
}
if (typeof body.excludeKeys == 'string') {
options.excludeKeys = body.excludeKeys;
}
if (typeof body.readPreference === 'string') {
options.readPreference = body.readPreference;
}