From 8b790f27d0f78d3b9a8dee31d6bbc430e480da64 Mon Sep 17 00:00:00 2001 From: mrcaos Date: Fri, 27 Nov 2015 17:54:51 +0800 Subject: [PATCH] fix the middleware first param [numPathComponents] --- lib/acl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acl.js b/lib/acl.js index 9a062a9..38f38b1 100644 --- a/lib/acl.js +++ b/lib/acl.js @@ -629,7 +629,7 @@ Acl.prototype.middleware = function(numPathComponents, userId, actions){ if(!numPathComponents){ resource = url; }else{ - resource = url.split('/').slice(0,numPathComponents+1).join('/'); + resource = url.split('/').slice(numPathComponents,numPathComponents+1).join('/'); } if(!_actions){