Merge branch 'bugfix/api-perms-request' into 'dev'

Fix API perms request returning stack

See merge request crafty-controller/crafty-4!745
This commit is contained in:
Iain Powrie 2024-04-06 23:11:30 +00:00
commit 27dae48cd2
2 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@ TBD
- Fix backend issue causing error when cloning servers in 4.3.x ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/741))
- Bump orjson for CVE-2024-27454 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/747))
- Fix calling of orjson JSONDecodeError class ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/747))
- Fix stack on Crafty permissions route request in API ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/745))
### Tweaks
- Clean up remaining http handler references ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/733))
- Remove version disclosure on login page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/737))

View File

@ -52,6 +52,8 @@ class ApiUsersUserPermissionsHandler(BaseApiHandler):
},
)
counter_data = PermissionsCrafty.get_created_quantity_list(user_id)
self.finish_json(
200,
{
@ -59,9 +61,9 @@ class ApiUsersUserPermissionsHandler(BaseApiHandler):
"data": {
"permissions": res_data.permissions,
"counters": {
SERVER_CREATION: res_data.created_server,
USER_CONFIG: res_data.created_user,
ROLES_CONFIG: res_data.created_role,
SERVER_CREATION: counter_data["SERVER_CREATION"],
USER_CONFIG: counter_data["USER_CONFIG"],
ROLES_CONFIG: counter_data["ROLES_CONFIG"],
},
"limits": {
SERVER_CREATION: res_data.limit_server_creation,