Skip to content

Commit

Permalink
Merge pull request #284 from cnpm/issue283-maintainer
Browse files Browse the repository at this point in the history
use common.isMaintainer, fixed #283
  • Loading branch information
fengmk2 committed Mar 20, 2014
2 parents 2e99a77 + 6d43612 commit cd9d403
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions controllers/registry/module.js
Expand Up @@ -445,10 +445,7 @@ exports.updateLatest = function *(next) {
debug('can not get nextMod');
return yield* next;
}
var match = nextMod.package.maintainers.filter(function (item) {
return item.name === username;
});
if (match.length === 0) {
if (!common.isMaintainer(this.user, nextMod.package.maintainers)) {
this.status = 401;
this.body = {
error: 'noperms',
Expand Down

0 comments on commit cd9d403

Please sign in to comment.