dosubot[bot] commented on issue #36110:
URL: https://github.com/apache/superset/issues/36110#issuecomment-3531259347
<!-- Answer -->
You can get role IDs in Superset 5.0.0 using the REST API endpoint:
`GET /api/v1/security/roles/search/` (make sure to include the trailing
slash).
To filter by role name (for example, "gamma" or "readonly"), use a query
parameter like this:
```
/api/v1/security/roles/search/?q={"filters":[{"col":"name","opr":"eq","value":"gamma"}]}
```
The response will include the role's `id` and `name`. You need to enable
`FAB_ADD_SECURITY_API = True` in your `superset_config.py` and restart Superset
for this endpoint to be available. Authentication and CSRF protection are
required. If you get a 404, double-check the trailing slash and your config.
You can then use the returned role IDs in your dashboard role assignment API
calls.
[Reference:
superset/security/api.py](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/api.py#L199-L344)
<!-- 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/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/d5a6b6be-8aa2-4ecd-865c-0ada0dba5daa?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](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/issues/36110)
--
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]