We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c363318 commit cd0d935Copy full SHA for cd0d935
1 file changed
src/getAuthorizedFields.js
@@ -6,6 +6,7 @@ function getAuthorizedFields(schema, authLevels, action) {
6
7
return _.chain(cleanedLevels)
8
.flatMap(level => schema.permissions[level][action])
9
+ .filter() // schema.pathType can't handle undefined values anymore (mongoose gh-6405)
10
.filter(path => schema.pathType(path) !== 'adhocOrUndefined') // ensure fields are in schema
11
.uniq() // dropping duplicates
12
.value();
0 commit comments