Skip to content

Commit 8d15354

Browse files
authored
HP-2069: add staff role admin (#61)
1 parent f74b64e commit 8d15354

File tree

4 files changed

+305
-39
lines changed

4 files changed

+305
-39
lines changed

src/files/items.php

+146-30
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'client.set-note',
4242
'purse.update',
4343
'purse.read',
44+
'purse.set-credit',
4445
],
4546
],
4647
'role:employee.manager' => [
@@ -93,12 +94,12 @@
9394
],
9495
'role:server.admin' => [
9596
'type' => 1,
96-
'description' => 'The role is generally assigned to staff who are in charge of client\'s servers administration',
97+
'description' => 'The role is generally assigned to reseller clients who are in charge of clients\' server administration',
9798
'children' => [
9899
'role:server.user',
99-
'server.create',
100-
'server.update',
101-
'server.delete',
100+
'server.read-wizzard',
101+
'server.read-legend',
102+
'server.read-system-info',
102103
'server.wizzard',
103104
'server.set-label',
104105
'consumption.read',
@@ -112,19 +113,35 @@
112113
'description' => 'The role is generally assigned to staff who are in charge of client\'s servers management',
113114
'children' => [
114115
'role:server.user',
116+
'server.read-wizzard',
115117
'server.enable-block',
116118
'server.disable-block',
117119
'server.pay',
118120
'server.sell',
119121
'server.set-label',
120122
'server.see-label',
123+
'server.read-legend',
124+
'server.read-financial-info',
125+
'server.read-manager',
126+
'server.read-billing',
127+
],
128+
],
129+
'role:server.staff-admin' => [
130+
'type' => 1,
131+
'description' => 'The role is generally assigned to staff who are in charge of client\'s servers administration',
132+
'children' => [
133+
'role:server.admin',
134+
'server.create',
135+
'server.delete',
136+
'server.update',
137+
'server.assign-hub',
121138
],
122139
],
123140
'role:server.master' => [
124141
'type' => 1,
125142
'description' => 'The role is generally assigned to staff who have exceptionally high permissions on servers management',
126143
'children' => [
127-
'role:server.admin',
144+
'role:server.staff-admin',
128145
'role:server.manager',
129146
],
130147
],
@@ -137,11 +154,18 @@
137154
],
138155
'role:hub.admin' => [
139156
'type' => 1,
140-
'description' => 'The role is generally assigned to staff who are in charge of client\'s hubs administration',
157+
'description' => 'The role is generally assigned to reseller staff who are in charge of clients\' hub administration',
141158
'children' => [
142159
'hub.read',
143-
'hub.create',
144160
'hub.update',
161+
],
162+
],
163+
'role:hub.staff-admin' => [
164+
'type' => 1,
165+
'description' => 'The role is generally assigned to staff who are in charge of client\'s hubs administration',
166+
'children' => [
167+
'role:hub.admin',
168+
'hub.create',
145169
'hub.delete',
146170
],
147171
],
@@ -157,7 +181,7 @@
157181
'type' => 1,
158182
'description' => 'The role is generally assigned to staff who have exceptionally high permissions on hubs management',
159183
'children' => [
160-
'role:hub.admin',
184+
'role:hub.staff-admin',
161185
'role:hub.manager',
162186
],
163187
],
@@ -452,6 +476,7 @@
452476
'description' => 'The role is generally assigned to staff who are in charge of bills management',
453477
'children' => [
454478
'bill.read',
479+
'charge.read',
455480
],
456481
],
457482
'role:bill.manager' => [
@@ -464,6 +489,7 @@
464489
'bill.delete',
465490
'deposit',
466491
'role:purse.manager',
492+
'charge.read',
467493
],
468494
],
469495
'role:bill.master' => [
@@ -519,6 +545,7 @@
519545
'price.update',
520546
'price.delete',
521547
'price.create',
548+
'plan.set-note',
522549
],
523550
],
524551
'role:plan.master' => [
@@ -834,7 +861,7 @@
834861
],
835862
'role:admin' => [
836863
'type' => 1,
837-
'description' => 'The role is generally assigned to staff who are in charge for the technical management of the resources',
864+
'description' => 'The role is generally assigned to reseller\'s clients who are in charge of the technical management of the resources',
838865
'children' => [
839866
'admin',
840867
'role:support',
@@ -844,6 +871,15 @@
844871
'role:hosting.admin',
845872
],
846873
],
874+
'role:staff-admin' => [
875+
'type' => 1,
876+
'description' => 'The role is generally assigned to staff who are in charge for the technical management of the resources',
877+
'children' => [
878+
'role:admin',
879+
'role:server.staff-admin',
880+
'role:hub.staff-admin',
881+
],
882+
],
847883
'role:accounter' => [
848884
'type' => 1,
849885
'description' => 'The role is generally assigned to staff who are in charge of accounting',
@@ -1096,7 +1132,7 @@
10961132
'type' => 1,
10971133
'description' => 'The role is for testing only',
10981134
'children' => [
1099-
'role:admin',
1135+
'role:staff-admin',
11001136
'role:manager',
11011137
'role:document.master',
11021138
'role:finance.master',
@@ -1249,6 +1285,14 @@
12491285
'type' => 2,
12501286
'description' => 'Prohibits reading of the purse',
12511287
],
1288+
'purse.set-credit' => [
1289+
'type' => 2,
1290+
'description' => 'Allows set credit to the purse',
1291+
],
1292+
'deny:purse.set-credit' => [
1293+
'type' => 2,
1294+
'description' => 'Prohibits set credit to purse',
1295+
],
12521296
'employee.read' => [
12531297
'type' => 2,
12541298
'description' => 'Allows reading of the employee',
@@ -1369,29 +1413,29 @@
13691413
'type' => 2,
13701414
'description' => 'Prohibits set-note operation on the server',
13711415
],
1372-
'server.create' => [
1416+
'server.read-wizzard' => [
13731417
'type' => 2,
1374-
'description' => 'Allows creating of the server',
1418+
'description' => 'Allows reading info about wizzarding of the server',
13751419
],
1376-
'deny:server.create' => [
1420+
'deny:server.read-wizzard' => [
13771421
'type' => 2,
1378-
'description' => 'Prohibits creating of the server',
1422+
'description' => 'Prohibits reading of the info about wizzarding of server',
13791423
],
1380-
'server.update' => [
1424+
'server.read-legend' => [
13811425
'type' => 2,
1382-
'description' => 'Allows updating of the server',
1426+
'description' => 'Allows reading legend of the server',
13831427
],
1384-
'deny:server.update' => [
1428+
'deny:server.read-legend' => [
13851429
'type' => 2,
1386-
'description' => 'Prohibits updating of the server',
1430+
'description' => 'Prohibits reading legend of the server',
13871431
],
1388-
'server.delete' => [
1432+
'server.read-system-info' => [
13891433
'type' => 2,
1390-
'description' => 'Allows deleting of the server',
1434+
'description' => 'Allows reading system info of the server',
13911435
],
1392-
'deny:server.delete' => [
1436+
'deny:server.read-system-info' => [
13931437
'type' => 2,
1394-
'description' => 'Prohibits deleting of the server',
1438+
'description' => 'Prohibits reading system info of the server',
13951439
],
13961440
'server.wizzard' => [
13971441
'type' => 2,
@@ -1465,21 +1509,69 @@
14651509
'type' => 2,
14661510
'description' => 'Prohibits selling of the server',
14671511
],
1468-
'hub.read' => [
1512+
'server.read-financial-info' => [
14691513
'type' => 2,
1470-
'description' => 'Allows reading of the hub',
1514+
'description' => 'Allows reading financial info of the server',
14711515
],
1472-
'deny:hub.read' => [
1516+
'deny:server.read-financial-info' => [
14731517
'type' => 2,
1474-
'description' => 'Prohibits reading of the hub',
1518+
'description' => 'Prohibits reading financial info of the server',
14751519
],
1476-
'hub.create' => [
1520+
'server.read-manager' => [
14771521
'type' => 2,
1478-
'description' => 'Allows creating of the hub',
1522+
'description' => 'Allows reading manager info of the server',
14791523
],
1480-
'deny:hub.create' => [
1524+
'deny:server.read-manager' => [
14811525
'type' => 2,
1482-
'description' => 'Prohibits creating of the hub',
1526+
'description' => 'Prohibits reading manager info of the server',
1527+
],
1528+
'server.read-billing' => [
1529+
'type' => 2,
1530+
'description' => 'Allow reading of tariff and sale information of server',
1531+
],
1532+
'deny:server.read-billing' => [
1533+
'type' => 2,
1534+
'description' => 'Prohibits reading of tariff and sale information of server',
1535+
],
1536+
'server.create' => [
1537+
'type' => 2,
1538+
'description' => 'Allows creating of the server',
1539+
],
1540+
'deny:server.create' => [
1541+
'type' => 2,
1542+
'description' => 'Prohibits creating of the server',
1543+
],
1544+
'server.delete' => [
1545+
'type' => 2,
1546+
'description' => 'Allows deleting of the server',
1547+
],
1548+
'deny:server.delete' => [
1549+
'type' => 2,
1550+
'description' => 'Prohibits deleting of the server',
1551+
],
1552+
'server.update' => [
1553+
'type' => 2,
1554+
'description' => 'Allows updating of the server',
1555+
],
1556+
'deny:server.update' => [
1557+
'type' => 2,
1558+
'description' => 'Prohibits updating of the server',
1559+
],
1560+
'server.assign-hub' => [
1561+
'type' => 2,
1562+
'description' => 'Allows assign hubs to server',
1563+
],
1564+
'deny:server.assign-hub' => [
1565+
'type' => 2,
1566+
'description' => 'Prohibits assign hub to server',
1567+
],
1568+
'hub.read' => [
1569+
'type' => 2,
1570+
'description' => 'Allows reading of the hub',
1571+
],
1572+
'deny:hub.read' => [
1573+
'type' => 2,
1574+
'description' => 'Prohibits reading of the hub',
14831575
],
14841576
'hub.update' => [
14851577
'type' => 2,
@@ -1489,6 +1581,14 @@
14891581
'type' => 2,
14901582
'description' => 'Prohibits updating of the hub',
14911583
],
1584+
'hub.create' => [
1585+
'type' => 2,
1586+
'description' => 'Allows creating of the hub',
1587+
],
1588+
'deny:hub.create' => [
1589+
'type' => 2,
1590+
'description' => 'Prohibits creating of the hub',
1591+
],
14921592
'hub.delete' => [
14931593
'type' => 2,
14941594
'description' => 'Allows deleting of the hub',
@@ -2059,6 +2159,14 @@
20592159
'type' => 2,
20602160
'description' => 'Prohibits reading of the bill',
20612161
],
2162+
'charge.read' => [
2163+
'type' => 2,
2164+
'description' => 'Allow reading of the charges',
2165+
],
2166+
'deny:charge.read' => [
2167+
'type' => 2,
2168+
'description' => 'Prohibits reading of the charges',
2169+
],
20622170
'bill.create' => [
20632171
'type' => 2,
20642172
'description' => 'Allows creating of the bill',
@@ -2203,6 +2311,14 @@
22032311
'type' => 2,
22042312
'description' => 'Prohibits creating of the price',
22052313
],
2314+
'plan.set-note' => [
2315+
'type' => 2,
2316+
'description' => 'Allows set note to plan',
2317+
],
2318+
'deny:plan.set-note' => [
2319+
'type' => 2,
2320+
'description' => 'Prohibits set note to plan',
2321+
],
22062322
'document.read' => [
22072323
'type' => 2,
22082324
'description' => 'Allows reading of the document',

0 commit comments

Comments
 (0)