GitHub user dosubot[bot] added a comment to the discussion: How Add dataset while creating/updating the roles using API
<!-- Answer --> Currently, Superset's REST API does not support assigning dataset or database permissions to roles. This is because menu permissions are static and manageable via the API, but object-level permissions like datasets and databases are dynamic and require backend logic that isn't exposed through the REST API. These permissions are managed internally by the SupersetSecurityManager class and can only be assigned via backend scripts or the Superset Admin UI, not through public API endpoints. If you need to automate this, you'll need to write a backend script that interacts with the security manager or use the UI for manual assignment. You can see more about the API's current capabilities and limitations in the [RoleRestAPI implementation](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/api.py) and the internal permission management logic in [SupersetSecurityManager](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/manager.py). <!-- 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/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/953c0577-dfae-45d9-ac79-03d9a7610341?feedback_type=other)</sup> [](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/34133) GitHub link: https://github.com/apache/superset/discussions/34133#discussioncomment-13730824 ---- 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]
