-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathroutemap.js
More file actions
49 lines (45 loc) · 1.39 KB
/
routemap.js
File metadata and controls
49 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var maps = {
'Administrator':{
'post_d_admin_update_merchant_status':0,
'post_d_admin_reset_merchant_password':0,
'post_d_admin_toggle_env':0,
'get_d_customers':1,
'get_d_settlements':1,
'post_d_settlements_initiate':1,
'get_d_transactions':1,
'get_d_merchants':1
},
'User':{
'post_d_admin_update_merchant_status':0,
'post_d_admin_reset_merchant_password':0,
'post_d_admin_toggle_env':0,
'post_d_settlements_initiate':0,
'get_d_customers':1,
'get_d_settlements':1,
'get_d_transactions':1,
'get_d_merchants':1
},
'Normal User':{
'post_d_admin_update_merchant_status':0,
'post_d_admin_reset_merchant_password':0,
'post_d_admin_toggle_env':0,
'post_d_settlements_initiate':0,
'get_d_customers':1,
'get_d_settlements':1,
'get_d_transactions':1,
'get_d_merchants':0
}
}
var models = require('mlar')('models');
var role_maps = [];
for(var p in maps){
for(var q in maps[p]){
role_maps.push({
role:p,
path:q,
accessible:maps[p][q]
})
}
}
//console.log(role_maps);
//models.rolemap.bulkCreate(role_maps);