✨ List users and logins
This commit is contained in:
parent
b8181be096
commit
0ea1de332b
20
cmd_share.go
20
cmd_share.go
|
@ -51,6 +51,26 @@ func (cmd *CmdShareList) Run(app *app) error {
|
||||||
|
|
||||||
for _, share := range shares {
|
for _, share := range shares {
|
||||||
fmt.Printf("* %s (%s)\n", share.UUID.String(), share.Name)
|
fmt.Printf("* %s (%s)\n", share.UUID.String(), share.Name)
|
||||||
|
shareUsers, err := app.shareStore.GetShareUsers(share)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf(" !! Users cannot be listed: %v\n", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for _, shareUser := range shareUsers {
|
||||||
|
fmt.Printf(" * User: %s (%s)\n", shareUser.Username, shareUser.Role)
|
||||||
|
shareLogins, err := app.shareStore.GetShareLogins(share, shareUser.Username)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf(" !! Logins cannot be listed: %v\n", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for _, shareLogin := range shareLogins {
|
||||||
|
info := ""
|
||||||
|
if shareLogin.ReadOnly {
|
||||||
|
info += " (readonly)"
|
||||||
|
}
|
||||||
|
fmt.Printf(" * Login: %s%s\n", shareLogin.LoginName, info)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue