Extend subuser session handling and refactor permissions in order booking routes

- Add token creation for subusers in `subusers_o` during session generation.
- Refactor `orderBookingRoute` to use dynamic subuser permission definitions with `subusers_permission_node_key`.
This commit is contained in:
Jeppe Bundgaard
2026-02-12 14:01:05 +01:00
parent d26b94de3b
commit 953067cba5
2 changed files with 6 additions and 2 deletions
@@ -228,6 +228,9 @@ class subusers_o extends db
$session_token = bin2hex(random_bytes(32));
$this->cache('session_token:' . $session_token, $this->id, 'subuser_sessions');
$this->setCachedExpiration('session_token:' . $session_token, 7 * 24 * 60 * 60, 'subuser_sessions'); // Set the session to expire after 7 days
// Add the token
$tokens_o = new tokens_o();
$tokens_o->create($this->id, $session_token, 'AUTH_TOKEN_SUBUSER');
return $session_token;
}