mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
fix auth system
This commit is contained in:
parent
834c155da4
commit
a016077bf3
1 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue