Phase 1: Critical security fixes - 59 permissions, grants, RLS, mass-assignment, ownership, leaks, MIME
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-08-03 22:32:03 +02:00
parent bd9fc15418
commit 4f970a11eb
9 changed files with 302 additions and 3 deletions
+14 -1
View File
@@ -20,11 +20,24 @@ async def get_system_settings(
db: AsyncSession = Depends(get_db),
current_user: dict = Depends(require_permission("settings:read")),
):
"""Get system settings for the current tenant."""
"""Get system settings for the current tenant.
Sensitive fields (tax_number, iban, bic) are masked for non-admin users.
"""
tenant_id = uuid.UUID(current_user["tenant_id"])
result = await system_settings_service.get_system_settings(db, tenant_id)
if result is None:
return SystemSettingsResponse()
# Mask sensitive fields for non-admin users
if not current_user.get("is_system_admin"):
if hasattr(result, "tax_number") and result.tax_number:
result.tax_number = "********"
if hasattr(result, "iban") and result.iban:
result.iban = "********"
if hasattr(result, "bic") and result.bic:
result.bic = "********"
return result