# Hide the "Query" tab in Panel Inspect for Viewer users (Grafana v12.3.1)

**URL:** <https://community.grafana.com/t/hide-the-query-tab-in-panel-inspect-for-viewer-users-grafana-v12-3-1/164934>\
**Category:** Configuration\
**Created:** [November 5, 2026, 10:30am UTC](https://community.grafana.com/t/hide-the-query-tab-in-panel-inspect-for-viewer-users-grafana-v12-3-1/164934 "2026-11-05T10:30:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zobelm98](https://avatars.discourse-cdn.com/v4/letter/z/48db29/32.png) [@zobelm98](https://community.grafana.com/u/zobelm98)\
**Post date:** [November 5, 2026, 10:30am UTC](https://community.grafana.com/t/hide-the-query-tab-in-panel-inspect-for-viewer-users-grafana-v12-3-1/164934/1 "2026-11-05T10:30:20Z")

</div>

Hi everyone,

I’m running **Grafana v12.3.1 (3a1c80ca7c)**, self-hosted.

**What I’m trying to do:**

I’d like users with the **Viewer** role to use a dashboard (filters, time range, data export) without seeing the SQL behind the panels.

**What I see**

- The user is a Viewer and can’t edit the dashboard. That part works as expected.
- From the panel menu, **Inspect** only shows _Data_ and _Panel JSON_.
- When the Inspect drawer opens, though, all tabs are there: **Data, Stats, Query and JSON**. In the **Query** tab the Viewer can click _Refresh_ and see the full SQL request and response.
- The SQL is also visible in the **JSON** tab, in the panel `targets`.

I found an older thread ([How to hide panel query in grafana](https://community.grafana.com/t/how-to-hide-panel-query-in-grafana/70776)) saying that a plain Viewer (not an org admin) shouldn’t see the Query tab. On v12.3.1 the tab is still visible for my Viewer users.

**Questions**

1. Is it expected in Grafana 12.x that Viewers can see the Query and JSON tabs in Panel Inspect?
2. Is there a setting, permission, feature toggle or RBAC option that hides these tabs, or disables Inspect entirely, for Viewers?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![infofcc3](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/infofcc3/32/51248_2.png) [@infofcc3](https://community.grafana.com/u/infofcc3)\
**Post date:** [November 6, 2026, 3:42am UTC](https://community.grafana.com/t/hide-the-query-tab-in-panel-inspect-for-viewer-users-grafana-v12-3-1/164934/2 "2026-11-06T03:42:48Z")

</div>

Hi,

This is how Grafana 12.x behaves. The Viewer role prevents editing, but it doesn’t hide panel queries or configuration.

**Query tab:** Shows the requests sent to the data source.  
**JSON tab:** Shows the panel configuration, including `targets`, which contains the SQL.

The older thread you found doesn’t match what you’re seeing on 12.3.1.  
As far as I know, Grafana has no built in setting, feature toggle or RBAC permission that hides these tabs, or disables Inspect, for Viewers.

Hiding them wouldn’t protect the SQL anyway, because it’s also visible in the browser’s network requests (`/api/ds/query`) and in the dashboard JSON returned by the API.

If the SQL must stay confidential →

Move the logic into database views or stored procedures, so panels only run something like `SELECT * FROM report_view`. Do the same for dashboard variable queries.

Give the data source a read only DB user limited to those views.

If even that is too much to expose, put a backend service between Grafana and the database.

Filters, time range and data export will keep working with this approach.
