Show provisioned users

This commit is contained in:
binwiederhier
2025-12-30 11:30:36 -05:00
parent 75b2ca7dec
commit 2a940ad289
4 changed files with 65 additions and 24 deletions

View File

@@ -24,15 +24,17 @@ func (s *Server) handleUsersGet(w http.ResponseWriter, r *http.Request, v *visit
userGrants := make([]*apiUserGrantResponse, len(grants[u.ID]))
for i, g := range grants[u.ID] {
userGrants[i] = &apiUserGrantResponse{
Topic: g.TopicPattern,
Permission: g.Permission.String(),
Topic: g.TopicPattern,
Permission: g.Permission.String(),
Provisioned: g.Provisioned,
}
}
usersResponse[i] = &apiUserResponse{
Username: u.Name,
Role: string(u.Role),
Tier: tier,
Grants: userGrants,
Username: u.Name,
Role: string(u.Role),
Tier: tier,
Grants: userGrants,
Provisioned: u.Provisioned,
}
}
return s.writeJSON(w, usersResponse)