GitHub user dosubot[bot] added a comment to the discussion: Restrict charts
<!-- Answer --> You should not modify superset/views/chart/filters.py—this file is legacy and only contains a minimal dataset access filter that is not used by the current chart API. All active chart filtering logic (including ownership and user-based filters) lives in superset/charts/filters.py and is registered in superset/charts/api.py for the ChartRestApi. For any custom chart access control, implement your filter in superset/charts/filters.py and register it in superset/charts/api.py. This is the current best practice and matches how Superset handles chart filtering now. [See code reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/charts/filters.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/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/878d3733-2204-41d7-a855-a95ee4cdce55?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=You%20should%20not%20modify%20superset/views/chart/filters.py%E2%80%94this%20file%20is%20legacy%20and%20only%20contains%20a%20minimal%20dataset%20access%20filter%20that%20is%20not%20used%20by%20the%20current%20chart%20API.%20All%20active%20chart%20filtering%20logic%20%28including%20ownership%20and%20user-based%20filters%29%20lives%20in%20superset/charts/filters.py%20and%20is%20registered%20in%20superset/charts/api.py%20for%20the%20ChartRestApi.%20For%20any%20custom%20chart%20access%20control%2C%20implement%20your%20filter%20in%20superset/charts/filters.py%20and%20register%20it%20in%20superset/charts/api.py.%20This%20is%20the%20current%20best%20practice%20and%20matches%20how%20Superset%20handles%20chart%20filtering%20now.%20%20%0A%5BSee%20code%20refere nce%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/charts/filters.py%29) [](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/36259) GitHub link: https://github.com/apache/superset/discussions/36259#discussioncomment-15074372 ---- 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]
