Permissions: Fix inherited folder permissions can prevent new permissions being added to a dashboard (#33329)

In the case permissions has been added on dashboard(s). Later permissions for the 
parent folder of the dashboard is edited in such a way that dashboard in that folder 
has a permission that is a duplicate of an inherited one. This PR changes so that 
duplicate permissions are now filtered out from /api/dashboards/id/<dashboard id>/permissions.
Duplicate permission are not filtered out if the permission on dashboard is higher 
than on the inherited folder.

Fixes #33296

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Marcus Efraimsson
2021-04-28 14:42:18 +02:00
committed by GitHub
co-authored by Arve Knudsen
parent 6d95f2f1db
commit 7e6db1ee7e
3 changed files with 90 additions and 1 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ func (hs *HTTPServer) GetDashboardPermissionList(c *models.ReqContext) response.
return dashboardGuardianResponse(err)
}
acl, err := g.GetAcl()
acl, err := g.GetACLWithoutDuplicates()
if err != nil {
return response.Error(500, "Failed to get dashboard permissions", err)
}