image genreation normal user permission fix

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-10 14:52:31 +00:00
parent c665c44aba
commit aba2c7da01
4 changed files with 1534 additions and 54 deletions

View File

@@ -101,10 +101,18 @@ The logout was NOT caused by backend issues or container restarts. It was caused
**RESOLVED** - Auth state stable, backend permissions correct, useLocation fix preserved.
**ADDITIONAL FIX (Dec 10, 2025 - Evening):**
- Fixed image generation task progress polling 403 errors
- Root cause: `IsSystemAccountOrDeveloper` was still in class-level permissions
- Solution: Moved to `get_permissions()` method to allow action-level overrides
- `task_progress` and `get_image_generation_settings` now accessible to all authenticated users
- Save/test operations still restricted to system accounts
1. **Permission Fix**: Fixed image generation task progress polling 403 errors
- Root cause: `IsSystemAccountOrDeveloper` was still in class-level permissions
- Solution: Moved to `get_permissions()` method to allow action-level overrides
- `task_progress` and `get_image_generation_settings` now accessible to all authenticated users
- Save/test operations still restricted to system accounts
**Monitor for 48 hours** - Watch for any recurrence of useLocation errors or auth issues after container restarts.
2. **System Account Fallback**: Fixed "Image generation settings not found" for normal users
- Root cause: IntegrationSettings are account-specific - normal users don't have their own settings
- Only super user account (aws-admin) has configured API keys
- Solution: Added fallback to system account (aws-admin) settings in `process_image_generation_queue` task
- When user's account doesn't have IntegrationSettings, falls back to system account
- Allows normal users to use centralized API keys managed by super users
- Files modified: `backend/igny8_core/ai/tasks.py`
**Monitor for 48 hours** - Watch for any recurrence of useLocation errors or auth issues after container restarts. Test image generation with normal user accounts (paid-2).