fix: solución de bloqueos y estandarización de permisos

This commit is contained in:
2026-04-27 10:47:30 -05:00
parent fa3cbb4d0a
commit 5c2a84e95d
312 changed files with 13889 additions and 7911 deletions

View File

@@ -42,7 +42,7 @@ async def get_classes_with_fa_data(
Get all classes with their FA data using a single LEFT JOIN query.
This endpoint is optimized for the fixed-asset-classes view.
"""
tenant_id = validate_access_to_resource(db, company_id, current_user)
tenant_id = validate_access_to_resource(db, company_id, current_user, ["goods_classes.view"])
skip = (page - 1) * page_size
@@ -74,7 +74,7 @@ async def create_fa_class(
):
"""Create a fixed asset class (both base class and FA extension)"""
tenant_id = validate_access_to_resource(db, company_id, current_user)
tenant_id = validate_access_to_resource(db, company_id, current_user, ["goods_classes.create"])
result = ClassService.create_fa_class(db, class_data, tenant_id, company_id)
@@ -95,6 +95,10 @@ crud_router = TenantCRUDRoutes(
enable_filters=True,
default_page_size=50,
max_page_size=1000,
list_permissions=["goods_classes.view"],
create_permissions=["goods_classes.create"],
update_permissions=["goods_classes.edit"],
delete_permissions=["goods_classes.delete"],
).router
# Include the CRUD routes into our main router