1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1× 1× | 'use strict'; function assertOrganizationIsMappedToApplication(organization, application, cb) { application.getAccountStoreMappings(function (err, mappings) { if (err) { return cb(err); } mappings.some(function (mapping, next) { next(organization && mapping.accountStore.href === organization.href); }, function (hasMatch) { cb(null, hasMatch); }); }); } module.exports = assertOrganizationIsMappedToApplication; |