GitHub user dosubot[bot] added a comment to the discussion: Table visible in SQL Lab but not available for Role-based datasource authorization
<!-- Greeting --> Hi @sukisevensuki-jpg! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> Yes, this is expected behavior. **Tables must be registered as Datasets before they appear in the role-based permissions dropdown.** SQL Lab uses a hierarchical permission system—if you have database or schema-level access, you can query any table directly. However, the "Data Sources" dropdown in Security → List Roles [only shows registered Datasets](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py#L1931-L1938), not all queryable tables. **To fix this:** 1. In SQL Lab, run a query on `youdata.sap_zmm25` 2. Click **Save** → **Save dataset** 3. The table will then appear in Security → List Roles → Data Sources Once saved, Superset [automatically creates the permission entry](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py#L1584-L1667) in the format `[database_name].[table_name](id:dataset_id)` that you can assign to roles. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/62853816-ed0d-481a-87e0-3c2316437240?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Yes%2C%20this%20is%20expected%20behavior.%20%2A%2ATables%20must%20be%20registered%20as%20Datasets%20before%20they%20appear%20in%20the%20role-based%20permissions%20dropdown.%2A%2A%0A%0ASQL%20Lab%20uses%20a%20hierarchical%20permission%20system%E2%80%94if%20you%20have%20database%20or%20schema-level%20access%2C%20you%20can%20query%20any%20table%20directly.%20However%2C%20the%20%22Data%20Sources%22%20dropdown%20in%20Security%20%E2%86%92%20List%20Roles%20%5Bonly%20shows%20registered%20Datasets%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py%23L1931-L1938%29%2C%20not%20all%20queryable%20tables.%0A%0A%2A%2ATo%20fix%20this%3A%2A%2A%0A1.%20In%20SQL%20Lab%2C%20run%20a%20query%20on%20%60yo udata.sap_zmm25%60%0A2.%20Click%20%2A%2ASave%2A%2A%20%E2%86%92%20%2A%2ASave%20dataset%2A%2A%0A3.%20The%20table%20will%20then%20appear%20in%20Security%20%E2%86%92%20List%20Roles%20%E2%86%92%20Data%20Sources%0A%0AOnce%20saved%2C%20Superset%20%5Bautomatically%20creates%20the%20permission%20entry%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py%23L1584-L1667%29%20in%20the%20format%20%60%5Bdatabase_name%5D.%5Btable_name%5D%28id%3Adataset_id%29%60%20that%20you%20can%20assign%20to%20roles.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38317) GitHub link: https://github.com/apache/superset/discussions/38317#discussioncomment-15967984 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
