init : "",\r
check : "String"\r
},\r
+ password : {\r
+ nullable : true,\r
+ check : "String"\r
+ },\r
roles : {\r
check : "Array"\r
},\r
this.base(arguments);\r
this.setRoles([]);\r
this.setNatures([]);\r
- this.setRawData({"password":"{SHA}ieSV55Qc+eQOaYDRSha/AjzNTJE="});\r
+ this.setRawData({password:null});\r
},\r
members : {\r
load : function(data, format){\r
this.setNatures(data.userNatures);\r
this.setRawData(data);\r
},\r
- getSaveService : function(){\r
+ getSaveService : function(self){\r
if(this.isCreate()){\r
- var userService = org.argeo.security.ria.SecurityAPI.getCreateUserService(this.toJSON()); \r
+ var userService = org.argeo.security.ria.SecurityAPI.getCreateUserService(this.toJSON(true)); \r
}else{\r
- var userService = org.argeo.security.ria.SecurityAPI.getUpdateUserService(this.toJSON()); \r
+ var userService = org.argeo.security.ria.SecurityAPI.getUpdateUserService(this.toJSON(), self); \r
}\r
userService.addListener("completed", function(response){\r
if(!response || !response.username) return;\r
}, this);\r
return userService; \r
},\r
- toJSON : function(){\r
+ toJSON : function(create){\r
var rawData = this.getRawData();\r
rawData.username = this.getName();\r
rawData.roles = this.getRoles();\r
rawData.userNatures = this.getNatures();\r
+ if(create) rawData.password = this.getPassword();\r
return rawData;\r
},\r
_getNatureByType : function(natureType){\r