<p>When I create a dashboard in Grafana and export it in JSON, the role, user and group permissions I define are not saved with it.</p>
<p>I am looking for a way to assign permissions for each dashboard in a Grafana deployment with Helm, in which I already include the dashboards to use.</p>
<p>Does anyone know if this is possible? I can't find a way to do it, can it only be done from web or from API?</p>
<p>Thanks.</p>

agallende
<p>Yes, you can assign permissions to dashboards in Grafana using Helm, as well as through the Grafana web UI or API.</p>
<p>To assign permissions using Helm, you can define a custom Grafana dashboard provisioning configuration file in your Helm chart's values.yaml or in a separate YAML file, and specify the appropriate permissions for each dashboard using the datasources, dashboards, and users sections. Here's an example:</p>
<h1>values.yaml or custom configuration file</h1>
<pre><code>grafana:
  provisioning:
    datasources:
      - name: &lt;datasource_name&gt;
        type: &lt;datasource_type&gt;
        access: proxy
        &lt;datasource-specific_configurations&gt; # e.g., url, basicAuth, etc.
    dashboards:
      - name: &lt;dashboard_name&gt;
        uid: &lt;dashboard_uid&gt; # unique identifier for the dashboard
        url: &lt;dashboard_url&gt; # URL of the JSON file for the dashboard
        permissions:
          role: &lt;role_name&gt; # role to assign the dashboard to
          user: &lt;user_name&gt; # user to assign the dashboard to
          team: &lt;team_name&gt; # team to assign the dashboard to
    users:
      - username: &lt;user_name&gt;
        role: &lt;role_name&gt;
</code></pre>
<p>In this example, you can specify the datasource configuration, dashboard configuration (including permissions), and user configuration using Helm values. Once you apply the Helm chart, Grafana will provision the dashboards with the specified permissions.</p>
<p>Note: Make sure to use the appropriate values for &lt;datasource_name&gt;, &lt;datasource_type&gt;, &lt;dashboard_name&gt;, &lt;dashboard_uid&gt;, &lt;dashboard_url&gt;, &lt;role_name&gt;, &lt;user_name&gt;, and &lt;team_name&gt; in your configuration.</p>
<p>Alternatively, you can also assign permissions to dashboards using the Grafana web UI or API. In the web UI, you can go to the dashboard settings, navigate to the &quot;Permissions&quot; tab, and specify the roles, users, or teams that should have access to the dashboard. You can also use the Grafana API to create, update, or delete dashboards with specific permissions using the appropriate API endpoints and payload.</p>
<p>Please note that in order to assign permissions to dashboards, you need to have appropriate permissions and roles configured in Grafana. Also, make sure to follow Grafana's documentation and best practices for securing your deployment and managing permissions effectively.</p>
