rsanchez
2017-04-13 84588a793c9484f9182d253ed83ad11687a1d4f8
securis/src/main/webapp/src/app/forms/user.form.component.ts
....@@ -23,6 +23,12 @@
2323 organizations_ids: [ 1, 2, 5, 6, 7, 8 ]
2424 }
2525
26
+const ROL = {
27
+ ADVANCE: 1,
28
+ ADMIN: 2,
29
+ BASIC: 4
30
+}
31
+
2632 @Component({
2733 selector: 'user-form',
2834 templateUrl: 'src/app/forms/user.form.html'
....@@ -32,7 +38,9 @@
3238 allApplications: IComboOption[];
3339 orgNames: string[] = [];
3440 appNames: string[] = [];
35
- allRoles: any[] = [{"id":4, "code": "basic","label":"Basic"}, {"id":1, "code": "advance", "label":"Advance"}, {"id":2, "code": "admin","label":"Admin"}];
41
+ allRoles: any[] = [{"id":ROL.BASIC, "code": "basic","label":"Basic"},
42
+ {"id":ROL.ADVANCE, "code": "advance", "label":"Advance"},
43
+ {"id":ROL.ADMIN, "code": "admin","label":"Admin"}];
3644 user_orgs: string[] = [];
3745 user_apps: string[] = [];
3846 user_roles: any = {};
....@@ -59,8 +67,9 @@
5967 var selectedApp = this.allApplications.find(app => app.label === appName);
6068 this.data.applications_ids.push(selectedApp.id);
6169 });
62
- this.user_roles.advance && this.data.roles.push(1);
63
- this.user_roles.admin && this.data.roles.push(2);
70
+ this.user_roles.basic && this.data.roles.push(ROL.BASIC);
71
+ this.user_roles.advance && this.data.roles.push(ROL.ADVANCE);
72
+ this.user_roles.admin && this.data.roles.push(ROL.ADMIN);
6473 super.save('username');
6574 }
6675