From 70f717a2958084faac9b3b652e62e2255098b091 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 11 Oct 2013 09:53:54 +0400 Subject: [PATCH] using undefined instead of anonymous for non-logged in users --- lib/config.js | 2 +- test/config-1.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config.js b/lib/config.js index 00079f12b..9201a6a81 100644 --- a/lib/config.js +++ b/lib/config.js @@ -106,7 +106,7 @@ function allow_action(package, who, action) { for (var i in this.packages) { if (minimatch.makeRe(i).exec(package)) { return this.packages[i][action].reduce(function(prev, curr) { - if (curr === who || curr === 'all') return true; + if (curr === String(who) || curr === 'all') return true; return prev; }, false); } diff --git a/test/config-1.yaml b/test/config-1.yaml index 6524068fe..7e7b0cdd3 100644 --- a/test/config-1.yaml +++ b/test/config-1.yaml @@ -22,8 +22,8 @@ packages: proxy_publish: server2 '*': - allow_access: test anonymous - allow_publish: test anonymous + allow_access: test undefined + allow_publish: test undefined # this should not matter testpkg: