mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Bug: fix a typo in dashboard permission logic (#77231)
fix an error handling typo
This commit is contained in:
parent
f6e2a775d3
commit
744f4defcf
@ -482,9 +482,7 @@ func (dr *DashboardServiceImpl) setDefaultPermissions(ctx context.Context, dto *
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dr.log.Error("Could not make user admin", "dashboard", dash.Title, "namespaceID", namespaceID, "userID", userID, "error", err)
|
dr.log.Error("Could not make user admin", "dashboard", dash.Title, "namespaceID", namespaceID, "userID", userID, "error", err)
|
||||||
}
|
} else if namespaceID == identity.NamespaceUser && userID > 0 {
|
||||||
|
|
||||||
if err != nil && namespaceID == identity.NamespaceUser && userID > 0 {
|
|
||||||
permissions = append(permissions, accesscontrol.SetResourcePermissionCommand{
|
permissions = append(permissions, accesscontrol.SetResourcePermissionCommand{
|
||||||
UserID: userID, Permission: dashboards.PERMISSION_ADMIN.String(),
|
UserID: userID, Permission: dashboards.PERMISSION_ADMIN.String(),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user