Skip to content

Conversation

eleijonmarck
Copy link
Contributor

@eleijonmarck eleijonmarck commented Sep 2, 2025

Fixes: #109542

We encountered that we were looking at viewersCanEdit for dashboard navigation, but not on panel level.

For instances having viewersCanEdit - true we enabled edit for dashboards but not for panels. The panel edit button was missing for viewersCanEdit setting.

Before this fix, panels did not show the edit button
image

After this fix, panels not correctly show the edit button for viewersCanEdit = true
image

@eleijonmarck eleijonmarck self-assigned this Sep 2, 2025
@eleijonmarck eleijonmarck requested a review from a team as a code owner September 2, 2025 16:44
@eleijonmarck eleijonmarck added the no-changelog Skip including change in changelog/release notes label Sep 2, 2025
@eleijonmarck eleijonmarck requested review from oscarkilhed and harisrozajac and removed request for a team September 2, 2025 16:44
@github-actions github-actions bot added this to the 12.2.x milestone Sep 2, 2025
Copy link
Contributor

@harisrozajac harisrozajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this logic to DashboardScene so it's inside canEditDashboard().

We can just do this:

  canEditDashboard() {
    const { meta } = this.state;

    return Boolean(meta.canEdit || meta.canMakeEditable || config.viewersCanEdit);
  }

Copy link
Contributor

@harisrozajac harisrozajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! 🚀

@eleijonmarck eleijonmarck merged commit ce70900 into main Sep 3, 2025
102 checks passed
@eleijonmarck eleijonmarck deleted the eleijonmarck/viewers-can-edit/panel-edit-button-missing branch September 3, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard: Can't edit panel on play.grafana.org
2 participants