From a016077bf3162cf150eabc5f02d424023c0c719c Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Sun, 14 Sep 2014 19:22:24 +0400 Subject: [PATCH] fix auth system --- lib/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config.js b/lib/config.js index d37d9a0ac..d9687f4f4 100644 --- a/lib/config.js +++ b/lib/config.js @@ -121,17 +121,17 @@ function Config(config) { function allow_action(package, who, action) { return (this.get_package_setting(package, action) || []).reduce(function(prev, curr) { if (typeof(who) === 'string' && curr === who) return true - if (Array.isArray(who.groups) && who.groups.indexOf(curr) !== -1) return true + if (Array.isArray(who) && who.indexOf(curr) !== -1) return true return prev }, false) } Config.prototype.allow_access = function(package, user) { - return allow_action.call(this, package, user.groups, 'allow_access') || allow_action.call(this, package, user, 'access') + return allow_action.call(this, package, user.groups, 'allow_access') || allow_action.call(this, package, user.groups, 'access') } Config.prototype.allow_publish = function(package, user) { - return allow_action.call(this, package, user.groups, 'allow_publish') || allow_action.call(this, package, user, 'publish') + return allow_action.call(this, package, user.groups, 'allow_publish') || allow_action.call(this, package, user.groups, 'publish') } Config.prototype.proxy_access = function(package, uplink) {