Skip to content

Commit

Permalink
auth: filterResponse filter items. Fix #73
Browse files Browse the repository at this point in the history
  • Loading branch information
kapouer committed Feb 15, 2020
1 parent 4e11688 commit 633a55b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/auth/index.js
Expand Up @@ -133,12 +133,17 @@ function locked(req, list) {

function filter(req, item, fn) {
if (!item.type) return item;
var {children, child, parents, parent} = item;
var {children, child, parents, parent, items} = item;
if (children) {
item.children = children.filter(function(item) {
return filter(req, item, fn);
});
}
if (items) {
item.items = items.filter(function(item) {
return filter(req, item, fn);
});
}
if (parents) {
item.parents = parents.filter(function(item) {
return filter(req, item, fn);
Expand Down

0 comments on commit 633a55b

Please sign in to comment.