Skip to content

Commit 44c7f47

Browse files
committed
fixing an issue in filtration + adding 6.0 testability to travis
1 parent 1b94f8d commit 44c7f47

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: node_js
33
node_js:
44
- '4.0'
55
- '5.0'
6+
- '6.0'
67
services:
78
- mongodb
89
before_script:

lib/helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
exports.siftPermissionMatrix = function(matrix, scopes, userScopes = [ '*' ]) {
3+
exports.siftPermissionMatrix = function(matrix, scopes, userScopes) {
44
if (matrix === true) return scopes[scopes.length - 1];
55
if (matrix === false) return matrix;
66
if (typeof matrix !== 'object' || Object.keys(matrix).length === 0) return false;

middleware/filter-fields.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = {
7878
}
7979
} else {
8080
const resource = filterRecord(req.rawResources, permissions, '_root');
81-
req.resource = Object.keys(resource).length > 0 ? resource : null;
81+
req.resource = Object.keys(resource).length > 0 ? resource : {};
8282
}
8383

8484
if (!req.resource || req.resource.length < 1) req.rawResourcesCount = 0;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phobosjs",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "A small JSON API framework for Mongoose and Express that takes all the annoyance of middleware out of your hands",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)