-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogressmatris.php
More file actions
43 lines (41 loc) · 1.24 KB
/
progressmatris.php
File metadata and controls
43 lines (41 loc) · 1.24 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
<?php
$actions = [
'skapa' => 'POST',
'ta bort' => 'DELETE',
'uppdatera' => 'PUT',
'visa' => 'GET',
'lista' => 'GET'
];
$userroles = [
'Resenär' => 'consumer',
'Kund-administratör' => 'ca',
'Administratör' => 'coa'
];
$objects = [
'Orderrad' => 'orderrows',
'Order' => 'orders',
'Kundvagnsrad' => 'cartrows',
'Kundvagn' => 'carts',
'Produkt' => 'products',
'Produktmall' => 'producttypes',
'Produktkategori' => 'productcategories',
'Produktkatalog' => 'catalogues',
/*
'Resenär' => 'consumers',
'Kund' => 'customers',
'THuvudman' => 'companys',
*/
];
foreach ($objects as $object => $objectName) {
foreach ($userroles as $userrole => $userroleName) {
echo 'BE:'.$userrole. ' ska kunna hantera ' .$object . "\n";
foreach ($actions as $action => $actionName) {
$index = ($action == 'visa' || $action == 'uppdatera' || $action == 'ta bort') ? true : false;
echo "\t" . '[] ' . $userrole . ' ska kunna ' . $action . ' ' . $object . ' ';
echo '(';
echo $actionName .' /'. $userroleName .'/'. $objectName . ($index ? '/<id>' : '');
echo ')';
echo "\n";
}
}
}