1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-17 01:53:17 +02:00

WIP tier CLI

This commit is contained in:
binwiederhier 2023-02-06 22:38:22 -05:00
parent 9b54f63eb1
commit e3b39f670f
10 changed files with 367 additions and 35 deletions

View file

@ -189,7 +189,11 @@ func showUsers(c *cli.Context, manager *user.Manager, users []*user.User) error
if err != nil {
return err
}
fmt.Fprintf(c.App.ErrWriter, "user %s (%s)\n", u.Name, u.Role)
tier := "none"
if u.Tier != nil {
tier = u.Tier.Name
}
fmt.Fprintf(c.App.ErrWriter, "user %s (role: %s, tier: %s)\n", u.Name, u.Role, tier)
if u.Role == user.RoleAdmin {
fmt.Fprintf(c.App.ErrWriter, "- read-write access to all topics (admin role)\n")
} else if len(grants) > 0 {