0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-01 02:42:23 -05:00

hotfix: auth groups didn't work correctly

This commit is contained in:
Alex Kocharin 2014-09-14 19:06:27 +04:00
parent c43846f14e
commit 19b1d76e98
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,8 @@
14 Sep 2014, version 0.10.1
14 Sep 2014, version 0.10.2
- hotfix: added missing dependency - `rimraf`
- hotfix: auth groups didn't work correctly
14 Sep 2014, version 0.10.0

View file

@ -121,7 +121,7 @@ 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) && who.indexOf(curr) !== -1) return true
if (Array.isArray(who.groups) && who.groups.indexOf(curr) !== -1) return true
return prev
}, false)
}