Add first routes for accounts management

This commit is contained in:
2025-04-03 23:14:55 +02:00
parent 03f57a0ad7
commit 72e67d9e91
14 changed files with 202 additions and 43 deletions

View File

@ -141,10 +141,10 @@ impl FromRequest for AuthExtractor {
// Check for authorization
let uri = req.uri().to_string();
let authorized = (uri.starts_with("/api/account/") && token.right_account)
|| (uri.starts_with("/api/movement/") && token.right_movement)
let authorized = (uri.starts_with("/api/accounts/") && token.right_account)
|| (uri.starts_with("/api/movements/") && token.right_movement)
|| (uri.starts_with("/api/inbox/") && token.right_inbox)
|| (uri.starts_with("/api/attachment/") && token.right_attachment)
|| (uri.starts_with("/api/attachments/") && token.right_attachment)
|| (uri.starts_with("/api/auth/") && token.right_auth);
if !authorized {