GitHub user dosubot[bot] added a comment to the discussion: Create role using 
API

<!-- Answer -->
This 404 error happens because, in Superset 4.0, the 
/api/v1/security/roles/search/ endpoint is not actually exposed as a REST 
API—even if you set FAB_ADD_SECURITY_API = True and restart. The code for the 
endpoint exists, but it is not registered with the API system, so requests to 
it will always return 404. This is a design/implementation omission in 4.0, and 
there is currently no supported REST API for listing roles in this version, 
regardless of configuration or flags. 

If you need to manage roles, you'll have to use the Superset UI or interact 
directly with the database (which is risky and not officially supported). If 
you deploy Superset under a custom URL prefix or behind a proxy, make sure your 
config includes ENABLE_PROXY_FIX = True and APPLICATION_ROOT is set correctly, 
but this won't resolve the missing endpoint issue—it's a limitation of the 
release itself. 

Keep an eye on future Superset releases for a fix or restoration of this API 
endpoint. If you need automation, you may need to look for community scripts or 
consider upgrading when a fix is available. 

References:  
- [Superset 4.0 RoleRestAPI code (not registered as REST 
API)](https://github.com/apache/superset/blob/6876a1e6843cd1f28f4206ca2dd75342dfddcf26/superset/security/api.py)
- [Superset initialization logic (RoleRestAPI not exposed as REST 
API)](https://github.com/apache/superset/blob/6876a1e6843cd1f28f4206ca2dd75342dfddcf26/superset/initialization/__init__.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/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/afbeddf6-6906-418f-b0ec-f24d88e86958?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Sh
 are on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/33878)

GitHub link: 
https://github.com/apache/superset/discussions/33878#discussioncomment-13572104

----
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]

Reply via email to