fix(server): 1.replace bolt with sqlite in config 2.add hardcoded listing roles

This commit is contained in:
hexxa 2022-09-16 11:28:51 +08:00 committed by Hexxa
parent d97451653e
commit 4f6683de03
9 changed files with 61 additions and 85 deletions

View file

@ -571,13 +571,13 @@ type ListRolesResp struct {
}
func (h *MultiUsersSvc) ListRoles(c *gin.Context) {
roles, err := h.deps.Users().ListRoles()
if err != nil {
c.JSON(q.ErrResp(c, 500, err))
return
}
c.JSON(200, &ListRolesResp{Roles: roles})
// TODO: currently roles are hardcoded
c.JSON(200, &ListRolesResp{
Roles: map[string]bool{
db.AdminRole: true,
db.UserRole: true,
db.VisitorRole: true,
}})
}
func (h *MultiUsersSvc) getUserInfo(c *gin.Context) (map[string]string, error) {