Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function authorize(req, res, next) {
/* Any user may search after bind, only cn=root has full power */
var isSearch = (req instanceof ldap.SearchRequest);
if (!req.connection.ldap.bindDN.equals('cn=admin,dc=example,dc=com'))
return next(new ldap.InsufficientAccessRightsError());
return next();
}
function authorize(req, res, next) {
/* Any user may search after bind, only cn=root has full power */
var isSearch = req instanceof ldap.SearchRequest
if (!req.connection.ldap.bindDN.equals('cn=root') && !isSearch) {
return next(new ldap.InsufficientAccessRightsError())
}
return next()
}
function authorize(req, res, next) {
/* Any user may search after bind, only cn=root has full power */
if (!req.connection.ldap.bindDN.equals(config.admin.username)) {
return next(new ldap.InsufficientAccessRightsError());
}
return next();
}
function authorize(req, res, next) {
const bindDN = req.connection.ldap.bindDN;
if (bindDN in authorizedUsers) {
return next();
}
return next(new ldap.InsufficientAccessRightsError());
}
function authorize(req, res, next) {
if (authreq === false) {
return next();
}
if (!(req.connection.ldap.bindDN.equals('cn=root') ||
req.connection.ldap.bindDN.equals('uid=alice, ou=people, dc=sixfour1, dc=com'))) {
return next(new ldap.InsufficientAccessRightsError());
}
return next();
}
function authorize(req, res, next) {
if (!req.connection.ldap.bindDN.equals('cn=ldapUser1,dc=example,dc=com'))
return next(new ldap.InsufficientAccessRightsError());
return next();
}
function authenticate(req, res, next) {
if ( req.connection.ldap.bindDN )
return next();
else
return next(new ldap.InsufficientAccessRightsError());
}
function authorize(req, res, next) {
if (!req.connection.ldap.bindDN.equals('cn=root')) {
return next(new ldap.InsufficientAccessRightsError());
}
return next();
}