1
Fork 0

Add canChangePassword to group status.

This commit is contained in:
Juliusz Chroboczek 2024-04-11 00:50:56 +02:00
parent 39d11c2f48
commit 077ff9a879
1 changed files with 22 additions and 15 deletions

View File

@ -1041,6 +1041,7 @@ type Status struct {
AuthPortal string `json:"authPortal,omitempty"`
Locked bool `json:"locked,omitempty"`
ClientCount *int `json:"clientCount,omitempty"`
CanChangePassword bool `json:"canChangePassword,omitempty"`
}
// Status returns a group's status.
@ -1097,6 +1098,12 @@ func (g *Group) Status(authentified bool, base *url.URL) Status {
d.Locked = locked
d.ClientCount = &count
}
if authentified {
conf, err := GetConfiguration()
if err == nil {
d.CanChangePassword = conf.WritableGroups
}
}
return d
}