(function(conjur, async, errback) { 'use strict'; var Generic = this.Generic; var Policy = this.Policy = function(args) { if (!(this instanceof Policy)) { return new Policy(args); } var superArguments = Array.prototype.slice.call(arguments); superArguments.unshift('policy'); Generic.apply(this, superArguments); return undefined; }; Policy.prototype = Object.create(Generic.prototype); Policy.prototype.constructor = Policy; Policy.prototype.fetch = function(callback, custom_errback) { var self = this, id = this.id; if (typeof(custom_errback) == 'undefined') { custom_errback = errback; // reset to default } async.parallel([ this.resource.bind(this), this.ownedResources.bind(this), this.allRoles.bind(this) ], function(err, results) { if (err) { return custom_errback(err.status); } callback({ policy: results[0], owned: results[1], roles: results[2], annotations: results[0].annotations }); return undefined; }); }; }).bind(conjur.models.Record) ( conjur, async, conjur.utils.errback );