Skip to content

Commit

Permalink
GetProjects: fill all permissions for admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Oct 1, 2022
1 parent 572abb6 commit 40e3cd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion configurator/backend/handlers/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,11 @@ func (oa *OpenAPI) GetProjects(ctx *gin.Context, params openapi.GetProjectsParam
mw.BadRequest(ctx, "Failed to get all projects", err)
return
} else {
ctx.JSON(http.StatusOK, projects)
projectsWithPerms := make([]openapi.ProjectWithPermissions, len(projects))
for i, project := range projects {
projectsWithPerms[i] = openapi.ProjectWithPermissions{Project: project, PermissionsInfo: openapi.PermissionsInfo(entities.DefaultProjectPermissions)}
}
ctx.JSON(http.StatusOK, projectsWithPerms)
return
}
}
Expand Down

0 comments on commit 40e3cd2

Please sign in to comment.