Bug: fix a typo in dashboard permission logic (#77231)

fix an error handling typo
This commit is contained in:
Ieva 2023-10-26 17:39:27 +01:00 committed by GitHub
parent f6e2a775d3
commit 744f4defcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -482,9 +482,7 @@ func (dr *DashboardServiceImpl) setDefaultPermissions(ctx context.Context, dto *
if err != nil {
dr.log.Error("Could not make user admin", "dashboard", dash.Title, "namespaceID", namespaceID, "userID", userID, "error", err)
}
if err != nil && namespaceID == identity.NamespaceUser && userID > 0 {
} else if namespaceID == identity.NamespaceUser && userID > 0 {
permissions = append(permissions, accesscontrol.SetResourcePermissionCommand{
UserID: userID, Permission: dashboards.PERMISSION_ADMIN.String(),
})