X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ria%2Fsrc%2Fargeo-ria-lib%2Fsecurity%2Fclass%2Forg%2Fargeo%2Fsecurity%2Fria%2Fmodel%2FUser.js;h=c5185355b3ff336152d64c8c7684ec7881ccaa42;hb=9b6a0645e8e964fd7bb04a63ddebbf2f14bd7779;hp=64ba63e4c898c95c3b13854e6b5b8dde06cfc807;hpb=b9f0dc6d3192adcbd4e9de8053b087e36759820e;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/model/User.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/model/User.js index 64ba63e4c..c5185355b 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/model/User.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/model/User.js @@ -5,6 +5,10 @@ qx.Class.define("org.argeo.security.ria.model.User", { init : "", check : "String" }, + password : { + nullable : true, + check : "String" + }, roles : { check : "Array" }, @@ -23,7 +27,7 @@ qx.Class.define("org.argeo.security.ria.model.User", { this.base(arguments); this.setRoles([]); this.setNatures([]); - this.setRawData({"password":"{SHA}ieSV55Qc+eQOaYDRSha/AjzNTJE="}); + this.setRawData({password:null}); }, members : { load : function(data, format){ @@ -33,11 +37,11 @@ qx.Class.define("org.argeo.security.ria.model.User", { this.setNatures(data.userNatures); this.setRawData(data); }, - getSaveService : function(){ + getSaveService : function(self){ if(this.isCreate()){ - var userService = org.argeo.security.ria.SecurityAPI.getCreateUserService(this.toJSON()); + var userService = org.argeo.security.ria.SecurityAPI.getCreateUserService(this.toJSON(true)); }else{ - var userService = org.argeo.security.ria.SecurityAPI.getUpdateUserService(this.toJSON()); + var userService = org.argeo.security.ria.SecurityAPI.getUpdateUserService(this.toJSON(), self); } userService.addListener("completed", function(response){ if(!response || !response.username) return; @@ -45,11 +49,12 @@ qx.Class.define("org.argeo.security.ria.model.User", { }, this); return userService; }, - toJSON : function(){ + toJSON : function(create){ var rawData = this.getRawData(); rawData.username = this.getName(); rawData.roles = this.getRoles(); rawData.userNatures = this.getNatures(); + if(create) rawData.password = this.getPassword(); return rawData; }, _getNatureByType : function(natureType){