Add permission definitions to route handlers

This update introduces explicit permission definitions for various route handlers across multiple routes. These changes enhance clarity and allow for more granular control over route access based on defined permissions. The updates ensure better manageability and scalability of endpoint permissions.
This commit is contained in:
Jepp9350
2025-02-20 14:33:42 +01:00
parent d9638406d3
commit d28cb172a0
35 changed files with 558 additions and 118 deletions
+20 -4
View File
@@ -54,7 +54,11 @@ class ordersRoute
// Return an error
$response->error('Invalid session', 400);
}
});
},
[
'list_orders' => 'List all orders'
]
);
$this->post('/orders', function () {
@@ -100,7 +104,11 @@ class ordersRoute
// Return an error
$response->error('Invalid session', 400);
}
});
},
[
'add_order' => 'Add an order'
]
);
$this->put('/orders', function () {
// Require the user to be logged in
@@ -152,7 +160,11 @@ class ordersRoute
// Return an error
$response->error('Invalid session', 400);
}
});
},
[
'edit_order' => 'Edit an order'
]
);
$this->delete('/orders', function () {
// Require the user to be logged in
@@ -186,7 +198,11 @@ class ordersRoute
// Return an error
$response->error('Invalid session', 400);
}
});
},
[
'delete_order' => 'Delete an order'
]
);
}
/**