Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
packagePermit = true;
break;
}
}
if (packagePermit || packageScopePermit) {
const perm = packagePermit ? 'package-name' : 'package-scope';
this.logger.debug(
`[gitlab] user: ${user.name || ''} allowed to publish package: ${_package.name} based on ${perm}`
);
return cb(null, true);
} else {
this.logger.debug(`[gitlab] user: ${user.name || ''} denied from publishing package: ${_package.name}`);
// @ts-ignore
const missingPerm = _package.name.indexOf('@') === 0 ? 'package-scope' : 'package-name';
return cb(getForbidden(`must have required permissions: ${this.publishLevel || ''} at ${missingPerm}`));
}
}