Merge pull request #293 from 8eo/master

Fix auth process to check against username also and not just groups
This commit is contained in:
Juan Picado @jotadeveloper 2017-08-17 06:20:10 +02:00 committed by GitHub
commit 5c51e485f6
1 changed files with 1 additions and 1 deletions

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