Check for user access in ldap ftp routes
This commit is contained in:
15
src/apps.js
15
src/apps.js
@@ -10,6 +10,7 @@ exports = module.exports = {
|
||||
get: get,
|
||||
getByContainerId: getByContainerId,
|
||||
getByIpAddress: getByIpAddress,
|
||||
getByFqdn: getByFqdn,
|
||||
getAll: getAll,
|
||||
getAllByUser: getAllByUser,
|
||||
install: install,
|
||||
@@ -477,6 +478,20 @@ function getByIpAddress(ip, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function getByFqdn(fqdn, callback) {
|
||||
assert.strictEqual(typeof fqdn, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
getAll(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
var app = result.find(function (a) { return a.fqdn === fqdn; });
|
||||
if (!app) return callback(new AppsError(AppsError.NOT_FOUND, 'No such app'));
|
||||
|
||||
callback(null, app);
|
||||
});
|
||||
}
|
||||
|
||||
function getAll(callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user