Updates based on review

This commit is contained in:
awgeorge
2019-02-22 09:45:22 +00:00
committed by Arthur Cinader
parent ff33c9939c
commit c5a5f57451
4 changed files with 13 additions and 16 deletions

View File

@@ -1439,7 +1439,7 @@ class DatabaseController {
[...(auth.userRoles || [])].forEach(role => {
const fields = protectedFields[role];
if (fields) {
protectedKeys = protectedKeys.filter(v => fields.includes(v));
protectedKeys = protectedKeys.filter(fields.includes);
}
});

View File

@@ -352,6 +352,7 @@ function injectDefaults(options: ParseServerOptions) {
console.warn(
`\nDEPRECATED: userSensitiveFields has been replaced by protectedFields allowing the ability to protect fields in all classes with CLP. \n`
);
/* eslint-enable no-console */
const userSensitiveFields = Array.from(
new Set([
@@ -360,7 +361,6 @@ function injectDefaults(options: ParseServerOptions) {
])
);
/* eslint-enable no-console */
options.protectedFields = { _User: { '*': userSensitiveFields } };
}