1
0
Fork 0
arangodb/js/apps/system/aardvark/frontend/js/models/arangoUsers.js

42 lines
725 B
JavaScript

/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*global Backbone, $, window */
window.Users = Backbone.Model.extend({
defaults: {
user: "",
active: false,
extra: {}
},
idAttribute : "user",
parse : function (d) {
this.isNotNew = true;
return d;
},
isNew: function () {
return !this.isNotNew;
},
url: function () {
if (this.get("user") !== "") {
return "/_api/user/" + this.get("user");
}
return "/_api/user";
},
initialize: function () {
},
isAuthorized: function () {
//return Boolean(this.get("sessionId");
return true;
},
isNotAuthorized: function () {
return false;
}
});