0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

Fix auth process to check against username also and not just groups

This commit is contained in:
Adam Szmyd 2017-08-15 12:21:28 +02:00
parent 0feccf9b4a
commit d0e0bc4ff3

View file

@ -66,7 +66,7 @@ class Auth {
const allow_action = function(action) {
return function(user, pkg, cb) {
let ok = pkg[action].reduce(function(prev, curr) {
if (user.groups.indexOf(curr) !== -1) return true;
if (user.name === curr || user.groups.indexOf(curr) !== -1) return true;
return prev;
}, false);