public/js/models/record.js in conjur-asset-ui-1.3.1 vs public/js/models/record.js in conjur-asset-ui-1.3.2
- old
+ new
@@ -1,7 +1,5 @@
-/* global conjur, jQuery */
-
(function(conjur, $, errback) {
'use strict';
var Generic = this.Generic = function(kind, id) {
this.kind = kind;
@@ -19,53 +17,54 @@
}
Generic.prototype.attributes = function(callback) {
var id = this.id;
- ajax('/api/'+
- conjur.utils.pluralize(this.kind) +
- '/' +
- window.encodeURIComponent(id),
+ ajax('/api/'
+ + conjur.utils.pluralize(this.kind)
+ + '/'
+ + window.encodeURIComponent(id),
callback);
};
Generic.prototype.resource = function(callback) {
- ajax('/api/authz/' +
- conjur.app.configuration.account +
- '/resources/' +
- this.kind +
- '/' +
- window.encodeURIComponent(this.id),
+ ajax('/api/authz/'
+ + conjur.app.configuration.account
+ + '/resources/'
+ + this.kind
+ + '/'
+ + window.encodeURIComponent(this.id),
callback);
};
Generic.prototype.ownedResources = function(callback) {
+ var id = this.id;
var roleid = [this.kind, this.id].join(':');
- ajax('/api/authz/' +
- conjur.app.configuration.account +
- '/resources?owner=' +
- roleid,
+ ajax('/api/authz/'
+ + conjur.app.configuration.account
+ + '/resources?owner='
+ + roleid,
function(err, result) {
if (typeof result.filter === 'function') {
result = result.filter(function(item) {
// assets of 'secret' kind are internal
- return item.id.split(':')[1] !== 'secret';
+ return item.id.split(':')[1] != 'secret';
});
}
callback(err, result);
});
};
Generic.prototype.allRoles = function(callback) {
- ajax('/api/authz/' +
- conjur.app.configuration.account +
- '/roles/' +
- window.encodeURIComponent(this.kind) +
- '/' +
- window.encodeURIComponent(this.id) +
- '?all',
+ ajax('/api/authz/'
+ + conjur.app.configuration.account
+ + '/roles/'
+ + window.encodeURIComponent(this.kind)
+ + '/'
+ + window.encodeURIComponent(this.id)
+ + '?all',
callback);
};
Generic.prototype.fetch = function(callback) {
this.attributes(function(err, data) {