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){