File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
test /
2
- README.md
2
+ README.md
3
+ .gitignore
4
+ .travis.yml
Original file line number Diff line number Diff line change @@ -48,8 +48,10 @@ module.exports = function (schema) {
48
48
49
49
if ( Array . isArray ( authLevel ) ) {
50
50
return authLevel . reduce ( function ( acc , level ) {
51
- var fields = vm . schema . permissions [ level ] [ action ] || [ ] ;
52
- return acc . concat ( fields )
51
+ if ( vm . schema . permissions [ level ] && vm . schema . permissions [ level ] [ action ] ) {
52
+ return acc . concat ( vm . schema . permissions [ level ] [ action ] )
53
+ }
54
+ return acc . concat ( [ ] )
53
55
} , [ ] ) ;
54
56
} else {
55
57
return vm . schema . permissions [ authLevel ] [ action ] || [ ] ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " mongoose-authorization" ,
3
- "version" : " 0.1.0 " ,
3
+ "version" : " 0.1.1 " ,
4
4
"description" : " Data level authorization for Mongoose" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments