dosubot[bot] commented on issue #30839: URL: https://github.com/apache/superset/issues/30839#issuecomment-2455819857
<!-- Greeting --> Hey @hscabral! 👋 I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together! <!-- Answer --> I found a similar closed issue that might be relevant to your situation: [Can't access database in SQL lab](https://github.com/apache/superset/issues/13689). This issue was referenced by another issue, [Can't access database in SQL lab](https://github.com/apache/superset/issues/28596), which was last updated on September 20, 2024 <sup>[[1]](https://github.com/apache/superset/issues/13689)</sup>. Regarding your specific problem, it seems like there might be a discrepancy between the schema permissions enforced in the UI and during SQL execution. Superset enforces schema permissions during SQL query execution by checking if the user has access to the specific schema permission using the `get_schema_perm` function. This function generates the schema permission string based on the database, catalog, and schema names, and checks if the user has the necessary access rights <sup>[[2]](https://github.com/apache/superset/blob/master/superset/security/manager.py)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset/commands/sql_lab/execute.py)</sup>. If the permissions are not being enforced as expected, it might be worth checking if there are any known workarounds or patches in the Superset codebase for handling schema permission issues. There are functions like `create_schema_perm` and `delete_schema_perm` that manage schema permissions, which might be useful in addressing this issue <sup>[[4]](https://github.com/apache/superset/blob/master/tests/integration_tests/security_tests.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- 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]
