mirror of https://gitee.com/bigwinds/arangodb
42 lines
725 B
JavaScript
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;
|
|
}
|
|
|
|
});
|