public/js/models/variableRecord.js in conjur-asset-ui-1.3.1 vs public/js/models/variableRecord.js in conjur-asset-ui-1.3.2
- old
+ new
@@ -1,7 +1,5 @@
-/* global conjur, jQuery, async */
-
(function(conjur, $, async, errback) {
'use strict';
var Generic = this.Generic;
@@ -18,26 +16,27 @@
};
Variable.prototype = Object.create(Generic.prototype);
Variable.prototype.constructor = Variable;
- Variable.prototype.fetch = function(callback, customErrback) {
- var id = this.id;
+ Variable.prototype.fetch = function(callback, custom_errback) {
+ var self = this,
+ id = this.id;
- if (typeof(customErrback) === 'undefined') {
- customErrback = errback; // reset to default
+ if (typeof(custom_errback) === 'undefined') {
+ custom_errback = errback; // reset to default
}
function members(privilege) {
return function(cb) {
$.ajax({
- url: '/api/authz/' +
- conjur.app.configuration.account +
- '/roles/allowed_to/' +
- privilege +
- '/variable/' +
- window.encodeURIComponent(id),
+ url: '/api/authz/'
+ + conjur.app.configuration.account
+ + '/roles/allowed_to/'
+ + privilege
+ + '/variable/'
+ + window.encodeURIComponent(id),
success: function(result) {
cb(null, result);
},
error: cb
});
@@ -49,10 +48,10 @@
members('execute'),
members('update'),
this.resource.bind(this)
], function(err, results) {
if (err) {
- return customErrback(err.status);
+ return custom_errback(err.status);
}
callback({
variable: results[0],
fetchers: results[1],