]> git.argeo.org Git - lgpl/argeo-commons.git/blob - ria/model/User.js
Prepare next development cycle
[lgpl/argeo-commons.git] / ria / model / User.js
1 qx.Class.define("org.argeo.security.ria.model.User", {
2 extend : qx.core.Object,
3 properties : {
4 name : {
5 init : "",
6 check : "String"
7 },
8 roles : {
9 check : "Array"
10 },
11 natures :{
12 check : "Array"
13 },
14 rawData : {
15
16 }
17 },
18 construct : function(){
19 this.base(arguments);
20 this.setRoles([]);
21 this.setNatures([]);
22 },
23 members : {
24 load : function(data, format){
25 this.setName(data.username);
26 this.setRoles(data.roles);
27 this.setNatures(data.userNatures);
28 this.setRawData(data);
29 },
30 toJSON : function(){
31 var rawData = this.getRawData();
32 rawData.username = this.getName();
33 rawData.roles = this.getRoles();
34 rawData.userNatures = this.getNatures();
35 }
36 }
37
38 });