1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 08:35:57 +01:00

Add canChangePassword to group status.

This commit is contained in:
Juliusz Chroboczek 2024-04-11 00:50:56 +02:00
parent 39d11c2f48
commit 077ff9a879

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
}