GitHub user dosubot[bot] added a comment to the discussion: Can i remove the 
view query , view as table options from dropdown of chart from a custom role i 
created.

<!-- Answer -->
Yes, you can selectively hide the "Edit chart", "View query", "View as table", 
and "Share" options for your Gamma_copy role without causing "access denied" 
errors. These options are shown or hidden in the UI based on specific 
permissions:

- Remove the `can_edit` permission on Chart to hide "Edit chart" 
[source](https://github.com/apache/superset/issues/32183).
- Remove `can_view_query on Dashboard` to hide "View query" 
[source](https://github.com/apache/superset/pull/30275).
- Remove `can_view_chart_as_table on Dashboard` to hide "View as table" 
[source](https://github.com/apache/superset/pull/30275).
- Remove `can share chart on Superset` and `can share dashboard on Superset` to 
hide "Share".

The frontend checks these permissions and hides the options if the user doesn't 
have them, so users won't see "access denied" errors—those menu items will 
simply not appear 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx).

Just make sure your role still has the basic read/list permissions needed for 
dashboards and charts, so the rest of the UI works as expected 
[source](https://github.com/apache/superset/issues/34587).


<!-- 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/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/674821c9-93af-4292-8495-37cf289cc8ac?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 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/34753)

GitHub link: 
https://github.com/apache/superset/discussions/34753#discussioncomment-14153256

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