diff --git a/modules/convert/user.go b/modules/convert/user.go index f3a33aee411d1..00ca34e4a5aa2 100644 --- a/modules/convert/user.go +++ b/modules/convert/user.go @@ -55,6 +55,8 @@ func toUser(user *models.User, signed, authed bool) *api.User { result.IsAdmin = user.IsAdmin result.LastLogin = user.LastLoginUnix.AsTime() result.Language = user.Language + result.IsActive = &user.IsActive + result.ProhibitLogin = &user.ProhibitLogin } return result } diff --git a/modules/structs/user.go b/modules/structs/user.go index 9e021e40fe880..60dc5491300a7 100644 --- a/modules/structs/user.go +++ b/modules/structs/user.go @@ -33,6 +33,10 @@ type User struct { Created time.Time `json:"created,omitempty"` // Is user restricted Restricted bool `json:"restricted"` + // Is user active + IsActive *bool `json:"active,omitempty"` + // Is user login prohibited + ProhibitLogin *bool `json:"prohibit_login,omitempty"` } // MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 5aeed4a30f493..c3fea6feff2d2 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16246,6 +16246,11 @@ "description": "User represents a user", "type": "object", "properties": { + "active": { + "description": "Is user active", + "type": "boolean", + "x-go-name": "IsActive" + }, "avatar_url": { "description": "URL to the user's avatar", "type": "string", @@ -16292,6 +16297,11 @@ "type": "string", "x-go-name": "UserName" }, + "prohibit_login": { + "description": "Is user login prohibited", + "type": "boolean", + "x-go-name": "ProhibitLogin" + }, "restricted": { "description": "Is user restricted", "type": "boolean",