bito-code-review[bot] commented on PR #39998:
URL: https://github.com/apache/superset/pull/39998#issuecomment-4415525813

   <!-- Bito Reply -->
   The flagged issue is correct: the code catches SupersetSecurityException and 
raises ImportFailedError (status 500), but permission-denied imports should 
return a 4xx status like 422. To resolve, remove the try-except block and 
directly call security_manager.raise_for_access(datasource=dataset) when not 
ignoring permissions. This lets SupersetSecurityException propagate, which maps 
to a 4xx error. The added test in the PR will need updating to expect 
SupersetSecurityException instead of ImportFailedError. No other comments in 
the PR.
   
   **superset/commands/dataset/importers/v1/utils.py**
   ```
   if not ignore_permissions:
           security_manager.raise_for_access(datasource=dataset)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to