mirror of
https://github.com/jech/galene.git
synced 2024-11-22 00:25:58 +01:00
Add canChangePassword to group status.
This commit is contained in:
parent
39d11c2f48
commit
077ff9a879
1 changed files with 22 additions and 15 deletions
|
@ -855,11 +855,11 @@ type Configuration struct {
|
|||
modTime time.Time `json:"-"`
|
||||
fileSize int64 `json:"-"`
|
||||
|
||||
PublicServer bool `json:"publicServer"`
|
||||
CanonicalHost string `json:"canonicalHost"`
|
||||
ProxyURL string `json:"proxyURL"`
|
||||
WritableGroups bool `json:"writableGroups"`
|
||||
Users map[string]UserDescription
|
||||
PublicServer bool `json:"publicServer"`
|
||||
CanonicalHost string `json:"canonicalHost"`
|
||||
ProxyURL string `json:"proxyURL"`
|
||||
WritableGroups bool `json:"writableGroups"`
|
||||
Users map[string]UserDescription
|
||||
|
||||
// obsolete fields
|
||||
Admin []ClientPattern `json:"admin"`
|
||||
|
@ -1031,16 +1031,17 @@ func (g *Group) GetPermission(creds ClientCredentials) (string, []string, error)
|
|||
}
|
||||
|
||||
type Status struct {
|
||||
Name string `json:"name"`
|
||||
Redirect string `json:"redirect,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
AuthServer string `json:"authServer,omitempty"`
|
||||
AuthPortal string `json:"authPortal,omitempty"`
|
||||
Locked bool `json:"locked,omitempty"`
|
||||
ClientCount *int `json:"clientCount,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Redirect string `json:"redirect,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
AuthServer string `json:"authServer,omitempty"`
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue